Class PostgreSQLDatabaseType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.datasource.StaticSQLDatabaseType
org.ametys.plugins.core.impl.datasource.PostgreSQLDatabaseType
- All Implemented Interfaces:
SQLDatabaseType
,LogEnabled
,PluginAware
,Configurable
Specifically handle Derby connections, allowing to actually shut the database down;
-
Field Summary
Fields inherited from class org.ametys.plugins.core.impl.datasource.StaticSQLDatabaseType
_driver, _driverNotFoundMessage, _id, _label, _languageEscapeTableNameTemplate, _languageLimitQueryTemplate, _pluginName, _template, _validationQuery
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the InputStream to read a blobGet the InputStream to read a blobvoid
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 useSQLDatabaseType.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 useSQLDatabaseType.setBlob(PreparedStatement, int, String)
void
setBlob
(PreparedStatement statement, int pos, String blob) Set an String into a blobMethods inherited from class org.ametys.plugins.core.impl.datasource.StaticSQLDatabaseType
configure, getDriver, getDriverNotFoundMessage, getId, getLabel, getTemplate, getValidationQuery, languageEscapeTableName, languageLimitQuery, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
PostgreSQLDatabaseType
public PostgreSQLDatabaseType()
-
-
Method Details
-
getBlob
Description copied from interface:SQLDatabaseType
Get the InputStream to read a blob- Specified by:
getBlob
in interfaceSQLDatabaseType
- Overrides:
getBlob
in classStaticSQLDatabaseType
- Parameters:
resultSet
- the result set containing the blob.columnName
- column- Returns:
- an InputStream to read the blob or null if the column is null
- Throws:
SQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
-
getBlob
Description copied from interface:SQLDatabaseType
Get the InputStream to read a blob- Specified by:
getBlob
in interfaceSQLDatabaseType
- Overrides:
getBlob
in classStaticSQLDatabaseType
- Parameters:
resultSet
- the result set containing the blob.pos
- column position- Returns:
- an InputStream to read the blob
- Throws:
SQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
-
setBlob
public void setBlob(PreparedStatement statement, int pos, String blob) throws SQLException, UnsupportedEncodingException Description copied from interface:SQLDatabaseType
Set an String into a blob- Specified by:
setBlob
in interfaceSQLDatabaseType
- Overrides:
setBlob
in classStaticSQLDatabaseType
- Parameters:
statement
- The satement where the blob will be setpos
- position in the statementblob
- String representing the blob. Can be null- Throws:
SQLException
- 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 supported
-
setBlob
Description copied from interface:SQLDatabaseType
Set an array of bytes (UTF-8 encoded) into a blob, if you want to pass a String, you can useSQLDatabaseType.setBlob(PreparedStatement, int, String)
- Specified by:
setBlob
in interfaceSQLDatabaseType
- Overrides:
setBlob
in classStaticSQLDatabaseType
- Parameters:
statement
- The satement where the blob will be setpos
- position in the statementbytes
- byte[] representing the blob, in UTF-8. Can be null- Throws:
SQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
-
setBlob
public void setBlob(PreparedStatement statement, int pos, InputStream is, long length) throws SQLException Description copied from interface:SQLDatabaseType
Set an array of bytes (UTF-8 encoded) into a blob, if you want to pass a String, you can useSQLDatabaseType.setBlob(PreparedStatement, int, String)
- Specified by:
setBlob
in interfaceSQLDatabaseType
- Overrides:
setBlob
in classStaticSQLDatabaseType
- Parameters:
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 stream- Throws:
SQLException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
-