
public abstract class DbModelH2 extends DbModelAbstract
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DbModelH2.DBType |
protected static class |
DbModelH2.DbTypeResolverH2 |
DbModelAbstract.DbTypeResolver| Modifier and Type | Field and Description |
|---|---|
protected org.h2.jdbcx.JdbcConnectionPool |
pool |
dbTypeResolver| Modifier | Constructor and Description |
|---|---|
protected |
DbModelH2()
Create the object and initialize if necessary the driver
|
protected |
DbModelH2(String dbserver,
String dbuser,
String dbpasswd)
Create the object and initialize if necessary the driver
|
| Modifier and Type | Method and Description |
|---|---|
int |
currentNumberOfPooledConnections() |
Connection |
getDbConnection(String server,
String user,
String passwd) |
DbType |
getDbType() |
String |
limitRequest(String allfields,
String request,
int nb)
Add a limit on the request to get the "limit" first rows.
|
long |
nextSequence(DbSession dbSession) |
void |
releaseResources()
Release any internal resources if needed
|
void |
resetSequence(DbSession session,
long newvalue)
Reset the sequence (example)
|
protected String |
validConnectionString() |
closeInternalConnection, getDbTypeResolver, validConnection, validConnectionSelectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateTables, needUpgradeDb, upgradeDbprotected DbModelH2(String dbserver, String dbuser, String dbpasswd) throws WaarpDatabaseNoConnectionException
dbserver - dbuser - dbpasswd - WaarpDatabaseNoConnectionExceptionprotected DbModelH2()
throws WaarpDatabaseNoConnectionException
public DbType getDbType()
public void releaseResources()
DbModelreleaseResources in interface DbModelreleaseResources in class DbModelAbstractpublic int currentNumberOfPooledConnections()
currentNumberOfPooledConnections in interface DbModelcurrentNumberOfPooledConnections in class DbModelAbstractpublic Connection getDbConnection(String server, String user, String passwd) throws SQLException
getDbConnection in interface DbModelgetDbConnection in class DbModelAbstractSQLExceptionpublic void resetSequence(DbSession session, long newvalue) throws WaarpDatabaseNoConnectionException
DbModelsession - SQL sessionWaarpDatabaseNoConnectionExceptionpublic long nextSequence(DbSession dbSession) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException, WaarpDatabaseNoDataException
WaarpDatabaseNoConnectionExceptionWaarpDatabaseSqlExceptionWaarpDatabaseNoDataExceptionprotected String validConnectionString()
validConnectionString in class DbModelAbstractpublic String limitRequest(String allfields, String request, int nb)
DbModel
On Oracle: select allfield from (request) where rownnum <= limit
On others: request LIMIT limit
allfields - string representing the equivalent to "*" in
"select
*" but more precisely as "field1,
field2" in "select field1, field2"Copyright © 2009–2020 Waarp. All rights reserved.