Package org.eclipse.jetty.server.session
Class DatabaseAdaptor
java.lang.Object
org.eclipse.jetty.server.session.DatabaseAdaptor
DatabaseAdaptor
 Handles differences between databases.
 Postgres uses the getBytes and setBinaryStream methods to access
 a "bytea" datatype, which can be up to 1Gb of binary data. MySQL
 is happy to use the "blob" type and getBlob() methods instead.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidadaptTo(DatabaseMetaData dbMeta) convertIdentifier(String identifier) Convert a camel case identifier into either upper or lower depending on the way the db stores identifiers.getBlobInputStream(ResultSet result, String columnName) protected ConnectionGet a connection from the driver or datasource.voidbooleanbooleanrowId is a reserved word for Oracle, so change the name of this columnvoidsetBlobType(String blobType) voidvoidsetDatasourceName(String jndi) voidsetDriverInfo(String driverClassName, String connectionUrl) Configure jdbc connection information via a jdbc DrivervoidsetDriverInfo(Driver driverClass, String connectionUrl) Configure jdbc connection information via a jdbc DrivervoidsetLongType(String longType) voidsetStringType(String stringType) toString()
- 
Field Details- 
_blobType
- 
_longType
- 
_stringType
 
- 
- 
Constructor Details- 
DatabaseAdaptorpublic DatabaseAdaptor()
 
- 
- 
Method Details- 
adaptTo- Throws:
- SQLException
 
- 
setBlobType
- 
getBlobType
- 
setLongType
- 
getLongType
- 
setStringType
- 
getStringType
- 
convertIdentifierConvert a camel case identifier into either upper or lower depending on the way the db stores identifiers.- Parameters:
- identifier- the raw identifier
- Returns:
- the converted identifier
 
- 
getDBName
- 
getBlobInputStream- Throws:
- SQLException
 
- 
isEmptyStringNullpublic boolean isEmptyStringNull()
- 
isRowIdReservedpublic boolean isRowIdReserved()rowId is a reserved word for Oracle, so change the name of this column- Returns:
- true if db in use is oracle
 
- 
setDriverInfoConfigure jdbc connection information via a jdbc Driver- Parameters:
- driverClassName- the driver classname
- connectionUrl- the driver connection url
 
- 
setDriverInfoConfigure jdbc connection information via a jdbc Driver- Parameters:
- driverClass- the driver class
- connectionUrl- the driver connection url
 
- 
setDatasource
- 
setDatasourceName
- 
getDatasourceName
- 
getDatasource
- 
getDriverClassName
- 
getDriver
- 
getConnectionUrl
- 
initialize- Throws:
- Exception
 
- 
getConnectionGet a connection from the driver or datasource.- Returns:
- the connection for the datasource
- Throws:
- SQLException- if unable to get the connection
 
- 
toString
 
-