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, validConnectionSelect
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTables, needUpgradeDb, upgradeDb
protected DbModelH2(String dbserver, String dbuser, String dbpasswd) throws WaarpDatabaseNoConnectionException
dbserver
- dbuser
- dbpasswd
- WaarpDatabaseNoConnectionException
protected DbModelH2() throws WaarpDatabaseNoConnectionException
public DbType getDbType()
public void releaseResources()
DbModel
releaseResources
in interface DbModel
releaseResources
in class DbModelAbstract
public int currentNumberOfPooledConnections()
currentNumberOfPooledConnections
in interface DbModel
currentNumberOfPooledConnections
in class DbModelAbstract
public Connection getDbConnection(String server, String user, String passwd) throws SQLException
getDbConnection
in interface DbModel
getDbConnection
in class DbModelAbstract
SQLException
public void resetSequence(DbSession session, long newvalue) throws WaarpDatabaseNoConnectionException
DbModel
session
- SQL sessionWaarpDatabaseNoConnectionException
public long nextSequence(DbSession dbSession) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException, WaarpDatabaseNoDataException
WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
WaarpDatabaseNoDataException
protected String validConnectionString()
validConnectionString
in class DbModelAbstract
public 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.