Class DatabaseAdaptor
java.lang.Object
org.eclipse.jetty.session.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 Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier 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
- 
DatabaseAdaptor
public DatabaseAdaptor() 
 - 
 - 
Method Details
- 
adaptTo
- Throws:
 SQLException
 - 
setBlobType
 - 
getBlobType
 - 
setLongType
 - 
getLongType
 - 
setStringType
 - 
getStringType
 - 
convertIdentifier
 - 
getDBName
 - 
getBlobInputStream
- Throws:
 SQLException
 - 
isEmptyStringNull
public boolean isEmptyStringNull() - 
isRowIdReserved
public boolean isRowIdReserved()rowId is a reserved word for Oracle, so change the name of this column- Returns:
 - true if db in use is oracle
 
 - 
setDriverInfo
 - 
setDriverInfo
 - 
setDatasource
 - 
setDatasourceName
 - 
getDatasourceName
 - 
getDatasource
 - 
getDriverClassName
 - 
getDriver
 - 
getConnectionUrl
 - 
initialize
 - 
getConnection
Get a connection from the driver or datasource.- Returns:
 - the connection for the datasource
 - Throws:
 SQLException- if unable to get the connection
 - 
toString
 
 -