public abstract class DbModelMariadb extends DbModelAbstract
Modifier and Type | Class and Description |
---|---|
protected static class |
DbModelMariadb.DBType |
Modifier and Type | Field and Description |
---|---|
protected org.mariadb.jdbc.MariaDbDataSource |
mysqlConnectionPoolDataSource |
protected DbConnectionPool |
pool |
Modifier | Constructor and Description |
---|---|
protected |
DbModelMariadb()
Create the object and initialize if necessary the driver
|
|
DbModelMariadb(String dbserver,
String dbuser,
String dbpasswd)
Create the object and initialize if necessary the driver
|
|
DbModelMariadb(String dbserver,
String dbuser,
String dbpasswd,
Timer timer,
long delay)
Create the object and initialize if necessary the driver
|
Modifier and Type | Method and Description |
---|---|
void |
createTables(DbSession session)
Create all necessary tables into the database
|
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, currentNumberOfPooledConnections, validConnection, validConnectionSelect
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
needUpgradeDb, upgradeDb
protected org.mariadb.jdbc.MariaDbDataSource mysqlConnectionPoolDataSource
protected DbConnectionPool pool
public DbModelMariadb(String dbserver, String dbuser, String dbpasswd, Timer timer, long delay) throws WaarpDatabaseNoConnectionException
dbserver
- dbuser
- dbpasswd
- timer
- delay
- WaarpDatabaseNoConnectionException
public DbModelMariadb(String dbserver, String dbuser, String dbpasswd) throws WaarpDatabaseNoConnectionException
dbserver
- dbuser
- dbpasswd
- WaarpDatabaseNoConnectionException
protected DbModelMariadb() throws WaarpDatabaseNoConnectionException
public DbType getDbType()
public Connection getDbConnection(String server, String user, String passwd) throws SQLException
getDbConnection
in interface DbModel
getDbConnection
in class DbModelAbstract
SQLException
public void releaseResources()
DbModel
releaseResources
in interface DbModel
releaseResources
in class DbModelAbstract
public void createTables(DbSession session) throws WaarpDatabaseNoConnectionException
DbModel
session
- SQL sessionWaarpDatabaseNoConnectionException
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
allfields
- string representing the equivalent to "*" in "select *" but more precisely as
"field1, field2" in "select field1, field2"Copyright © 2009–2019 Waarp. All rights reserved.