public interface SQLDatabaseType
Modifier and Type | Method and Description |
---|---|
InputStream |
getBlob(ResultSet resultSet,
int pos)
Get the InputStream to read a blob
|
InputStream |
getBlob(ResultSet resultSet,
String columnName)
Get the InputStream to read a blob
|
String |
getDriver()
Get the driver of the database type.
|
I18nizableText |
getDriverNotFoundMessage()
Get the error message key when the specified driver was not found
|
String |
getId()
Get the id of the database type.
|
I18nizableText |
getLabel()
Get the label of the database type.
|
String |
getTemplate()
Get the url template to use for this database type
|
String |
getValidationQuery()
Get the query to validate a connection
|
String |
languageEscapeTableName(String tableNameToEscape)
Some db systems requires the table names to be escaped
|
String |
languageLimitQuery(String queryToLimit,
String limit,
String offset)
Add a limit/offset element to the given query
|
void |
setBlob(PreparedStatement statement,
int pos,
byte[] bytes)
Set an array of bytes (UTF-8 encoded) into a blob, if you want to pass a String, you can use
setBlob(PreparedStatement, int, String) |
void |
setBlob(PreparedStatement statement,
int pos,
InputStream is,
long length)
Set an array of bytes (UTF-8 encoded) into a blob, if you want to pass a String, you can use
setBlob(PreparedStatement, int, String) |
void |
setBlob(PreparedStatement statement,
int pos,
String blob)
Set an String into a blob
|
I18nizableText getLabel()
String getDriver()
String getValidationQuery()
String getTemplate()
I18nizableText getDriverNotFoundMessage()
String languageEscapeTableName(String tableNameToEscape)
tableNameToEscape
- The non-null table nameString languageLimitQuery(String queryToLimit, String limit, String offset)
queryToLimit
- The sql query that will be amendedlimit
- The max number of the results to returnoffset
- The initial offset of the results to returnInputStream getBlob(ResultSet resultSet, String columnName) throws SQLException
resultSet
- the result set containing the blob.columnName
- columnSQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result setInputStream getBlob(ResultSet resultSet, int pos) throws SQLException
resultSet
- the result set containing the blob.pos
- column positionSQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result setvoid setBlob(PreparedStatement statement, int pos, String blob) throws SQLException, UnsupportedEncodingException
statement
- The satement where the blob will be setpos
- position in the statementblob
- String representing the blob. Can be nullSQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result setUnsupportedEncodingException
- if UTF-8 is not supportedvoid setBlob(PreparedStatement statement, int pos, byte[] bytes) throws SQLException
setBlob(PreparedStatement, int, String)
statement
- The satement where the blob will be setpos
- position in the statementbytes
- byte[] representing the blob, in UTF-8. Can be nullSQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result setvoid setBlob(PreparedStatement statement, int pos, InputStream is, long length) throws SQLException
setBlob(PreparedStatement, int, String)
statement
- The satement where the blob will be setpos
- position in the statementis
- inputStream to put in the blob. Can be nulllength
- length of the streamSQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set