Search in sources :

Example 16 with CallableStatement

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

the class FilterChainImplTest2 method test_getTimestamp_3.

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

Example 17 with CallableStatement

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

the class FilterChainImplTest2 method test_getObject_1.

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

Example 18 with CallableStatement

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

the class FilterChainImplTest2 method test_getObject_2.

public void test_getObject_2() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertNull(stmt.getObject(1, Collections.<String, Class<?>>emptyMap()));
    stmt.close();
    conn.close();
}
Also used : CallableStatement(java.sql.CallableStatement) Connection(java.sql.Connection)

Example 19 with CallableStatement

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

the class FilterChainImplTest2 method test_getSQLXML_1.

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

Example 20 with CallableStatement

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

the class FilterChainImplTest2 method test_getObject_3.

public void test_getObject_3() throws Exception {
    Connection conn = dataSource.getConnection();
    CallableStatement stmt = conn.prepareCall("select ?");
    stmt.registerOutParameter(1, Types.VARCHAR);
    Assert.assertNull(stmt.getObject("1", Collections.<String, Class<?>>emptyMap()));
    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