org.hsqldb.jdbc.JDBCDriver Java Examples

The following examples show how to use org.hsqldb.jdbc.JDBCDriver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JDBCXADataSource.java    From evosql with Apache License 2.0 6 votes vote down vote up
/**
     * Get new XAConnection connection, to be managed by a connection manager.
     */
    public XAConnection getXAConnection() throws SQLException {

        // Comment out before public release:
/*
        System.err.print("Executing " + getClass().getName()
                         + ".getXAConnection()...");
*/

        // Use JDBCDriver directly so there is no need to register with DriverManager
        JDBCConnection connection =
            (JDBCConnection) JDBCDriver.getConnection(url, connectionProps);
        JDBCXAConnection xaConnection = new JDBCXAConnection(this, connection);

        return xaConnection;
    }
 
Example #2
Source File: JdbcServlet.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@Override
public void executeApp() throws Exception {
    if (connection == null) {
        connection = JDBCDriver.getConnection("jdbc:hsqldb:mem:test", null);
        Statement statement = connection.createStatement();
        try {
            statement.execute("create table employee (name varchar(100))");
            statement.execute("insert into employee (name) values ('john doe')");
            statement.execute("insert into employee (name) values ('jane doe')");
            statement.execute("insert into employee (name) values ('sally doe')");
        } finally {
            statement.close();
        }
    }
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/jdbcservlet");
    MockHttpServletResponse response = new MockHttpServletResponse();
    service((ServletRequest) request, (ServletResponse) response);
}
 
Example #3
Source File: Session.java    From evosql with Apache License 2.0 4 votes vote down vote up
void releaseInternalConnection() {

        if (sessionContext.depth == 0) {
            JDBCDriver.driverInstance.threadConnection.set(null);
        }
    }
 
Example #4
Source File: Connections.java    From glowroot with Apache License 2.0 4 votes vote down vote up
private static Connection createHsqldbConnection() throws SQLException {
    Connection connection = JDBCDriver.getConnection("jdbc:hsqldb:mem:test", null);
    insertRecords(connection);
    return connection;
}
 
Example #5
Source File: PooledDatasourceHelperTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Test
public void testGetDriverLegacy() {
  IDatabaseDialect dialect = mock( IDatabaseDialect.class );
  assertEquals( JDBCDriver.class, PooledDatasourceHelper.getDriver( dialect, JDBCDriver.class.getCanonicalName(), null ).getClass() );
}
 
Example #6
Source File: JDBCPooledDataSource.java    From evosql with Apache License 2.0 3 votes vote down vote up
public PooledConnection getPooledConnection() throws SQLException {

        JDBCConnection connection =
            (JDBCConnection) JDBCDriver.getConnection(url, connectionProps);

        return new JDBCPooledConnection(connection);
    }
 
Example #7
Source File: JDBCPooledDataSource.java    From evosql with Apache License 2.0 3 votes vote down vote up
public PooledConnection getPooledConnection(String user,
        String password) throws SQLException {

    Properties props = new Properties();

    props.setProperty("user", user);
    props.setProperty("password", password);

    JDBCConnection connection =
        (JDBCConnection) JDBCDriver.getConnection(url, props);

    return new JDBCPooledConnection(connection);
}