use of com.wplatform.ddal.engine.SessionInterface in project jdbc-shards by wplatform.
the class JdbcDataSource method getConnection.
/**
* Open a new connection using the current URL and the specified user name
* and password.
*
* @param user the user name
* @param password the password
* @return the connection
*/
@Override
public Connection getConnection(String user, String password) throws SQLException {
User userObject = database.getUser(user);
SessionInterface session = database.createSession(userObject);
JdbcConnection conn = new JdbcConnection(session, user, this.configLocation);
return conn;
}
use of com.wplatform.ddal.engine.SessionInterface in project jdbc-shards by wplatform.
the class JdbcStatement method checkClosed.
/**
* INTERNAL.
* Check if the statement is closed.
*
* @param write if the next operation is possibly writing
* @return true if a reconnect was required
* @throws DbException if it is closed
*/
protected boolean checkClosed(boolean write) {
if (conn == null) {
throw DbException.get(ErrorCode.OBJECT_CLOSED);
}
conn.checkClosed(write);
SessionInterface s = conn.getSession();
if (s != session) {
session = s;
trace = session.getTrace();
return true;
}
return false;
}
Aggregations