public class DBDataProvider extends CommonDataProvider implements DataInputProvider
CommonDataProvider.ResultColumnNames
DataProvider.type
columns, dataInPath, dataOutPath, indexData, resultColumnName, scenarioName
Constructor and Description |
---|
DBDataProvider(String type,
String user,
String password,
String hostname,
String port,
String database) |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection() |
int |
getNbLines()
Gets the number of readable lines of current opened file.
|
void |
prepare(String scenario) |
String[] |
readLine(int line,
boolean readResult) |
String |
readValue(String column,
int line)
Reads a cell of opened input file.
|
protected static void |
sqlSanitized4readOnly(String sqlInput) |
getIndexData, getModel, getNbGherkinExample, getResultColumnName, isResultColumnNameAuthorized, setDataInPath, setDataOutPath, setIndexData, writeDataResult, writeFailedResult, writeSuccessResult, writeValue, writeWarningResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIndexData, getModel, getNbGherkinExample, getResultColumnName, isResultColumnNameAuthorized, setDataInPath, setDataOutPath, setIndexData
public DBDataProvider(String type, String user, String password, String hostname, String port, String database) throws TechnicalException
TechnicalException
public Connection getConnection() throws SQLException
SQLException
public void prepare(String scenario) throws TechnicalException
prepare
in interface DataProvider
TechnicalException
public int getNbLines() throws TechnicalException
getNbLines
in interface DataInputProvider
TechnicalException
- is thrown if you have a technical error (IOException on .sql file) in NoraUi.public String readValue(String column, int line) throws TechnicalException
readValue
in interface DataInputProvider
column
- index of the column to readline
- index of the line to readTechnicalException
- is thrown if you have a technical error (IOException on .sql file) in NoraUi.public String[] readLine(int line, boolean readResult) throws TechnicalException
readLine
in interface DataInputProvider
line
- id of the line to read (line=0 for reading headers ; line=1 for reading 1st line, ...)readResult
- true if result must be returned, false otherwiseTechnicalException
- is thrown if you have a technical error (IOException on .sql file) in NoraUi.protected static void sqlSanitized4readOnly(String sqlInput) throws TechnicalException
TechnicalException
Copyright © 2023 NoraUi. All rights reserved.