Search in sources :

Example 11 with CallableStatement

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

the class FilterChainImplTest2 method test_getString.

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

Example 12 with CallableStatement

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

the class FilterChainImplTest2 method test_getBoolean.

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

Example 13 with CallableStatement

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

the class FilterChainImplTest2 method test_getShort.

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

Example 14 with CallableStatement

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

the class FilterChainImplTest2 method test_getRef.

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

Example 15 with CallableStatement

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

the class FilterChainImplTest2 method test_getTime_2.

public void test_getTime_2() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertNull(stmt.getTime(1, null));
    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