Search in sources :

Example 21 with CallableStatement

use of java.sql.CallableStatement in project druid by alibaba.

the class FilterChainImplTest2 method test_getDate_1.

public void test_getDate_1() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertNull(stmt.getDate("1"));
    stmt.close();
    conn.close();
}
Also used : CallableStatement(java.sql.CallableStatement) Connection(java.sql.Connection)

Example 22 with CallableStatement

use of java.sql.CallableStatement in project druid by alibaba.

the class FilterChainImplTest2 method test_getBlob.

public void test_getBlob() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertNull(stmt.getBlob(1));
    stmt.close();
    conn.close();
}
Also used : CallableStatement(java.sql.CallableStatement) Connection(java.sql.Connection)

Example 23 with CallableStatement

use of java.sql.CallableStatement in project druid by alibaba.

the class FilterChainImplTest2 method test_getTime.

public void test_getTime() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertNull(stmt.getTime(1));
    stmt.close();
    conn.close();
}
Also used : CallableStatement(java.sql.CallableStatement) Connection(java.sql.Connection)

Example 24 with CallableStatement

use of java.sql.CallableStatement in project druid by alibaba.

the class FilterChainImplTest2 method test_getLong_1.

public void test_getLong_1() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertEquals(0, stmt.getLong("1"));
    stmt.close();
    conn.close();
}
Also used : CallableStatement(java.sql.CallableStatement) Connection(java.sql.Connection)

Example 25 with CallableStatement

use of java.sql.CallableStatement in project druid by alibaba.

the class FilterChainImplTest2 method test_getRowId_1.

public void test_getRowId_1() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertNull(stmt.getRowId("1"));
    stmt.close();
    conn.close();
}
Also used : CallableStatement(java.sql.CallableStatement) Connection(java.sql.Connection)

Aggregations

CallableStatement (java.sql.CallableStatement)259 SQLException (java.sql.SQLException)131 Connection (java.sql.Connection)123 ResultSet (java.sql.ResultSet)54 DatabaseAccessException (com.axway.ats.log.autodb.exceptions.DatabaseAccessException)45 DbConnection (com.axway.ats.core.dbaccess.DbConnection)28 Checkpoint (com.axway.ats.log.autodb.entities.Checkpoint)22 PreparedStatement (java.sql.PreparedStatement)21 ArrayList (java.util.ArrayList)21 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)20 Timestamp (java.sql.Timestamp)18 Test (org.junit.Test)16 CouldntDeleteException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntDeleteException)15 Statement (java.sql.Statement)13 CConnection (com.google.security.zynamics.binnavi.Database.CConnection)8 HashMap (java.util.HashMap)8 MockCallableStatement (com.alibaba.druid.mock.MockCallableStatement)7 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)6 OracleCallableStatement (oracle.jdbc.OracleCallableStatement)6 Session (org.hibernate.Session)6