test_class.file: code/src/test/java/com/googlecode/cqengine/index/sqlite/support/DBUtilsTest.java
test_class.identifier: DBUtilsTest
test_case.body: @Test
      public void testSetValueToPreparedStatement() throws Exception {
          PreparedStatement statement = mock(PreparedStatement.class);
  
          // Date / Time
          final long now = System.currentTimeMillis();
  
          DBUtils.setValueToPreparedStatement(1,statement, new java.util.Date(now));
          verify(statement).setLong(1, now);
  
          DBUtils.setValueToPreparedStatement(2,statement, new java.sql.Date(now));
          verify(statement).setLong(2, now);
  
          DBUtils.setValueToPreparedStatement(3,statement, new Time(now));
          verify(statement).setLong(3, now);
  
          DBUtils.setValueToPreparedStatement(4,statement, new Timestamp(now));
          verify(statement).setLong(4, now);
  
          // String and CharSequence
          final String str = "This is a string";
          final StringBuilder stringBuilder = new StringBuilder("This is a CharSequence");
          DBUtils.setValueToPreparedStatement(5,statement, str);
          verify(statement).setString(5, "This is a string");
  
  
          DBUtils.setValueToPreparedStatement(6,statement, stringBuilder);
          verify(statement).setString(6, "This is a CharSequence");
  
          // Others...use setObject
          DBUtils.setValueToPreparedStatement(7,statement, Boolean.FALSE);
          verify(statement).setObject(7, Boolean.FALSE);
  
          DBUtils.setValueToPreparedStatement(7,statement, Long.MAX_VALUE);
          verify(statement).setObject(7, Long.MAX_VALUE);
  
          DBUtils.setValueToPreparedStatement(8,statement, "bytes".getBytes());
          verify(statement).setObject(8, "bytes".getBytes());
      }
test_case.class_method_signature: DBUtilsTest.testSetValueToPreparedStatement()
test_case.full_signature: @Test public void testSetValueToPreparedStatement()
test_case.identifier: testSetValueToPreparedStatement
test_case.invocations: mock currentTimeMillis setValueToPreparedStatement setLong verify setValueToPreparedStatement setLong verify setValueToPreparedStatement setLong verify setValueToPreparedStatement setLong verify setValueToPreparedStatement setString verify setValueToPreparedStatement setString verify setValueToPreparedStatement setObject verify setValueToPreparedStatement setObject verify setValueToPreparedStatement getBytes setObject verify getBytes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSetValueToPreparedStatement()
focal_class.file: code/src/main/java/com/googlecode/cqengine/index/sqlite/support/DBUtils.java
focal_class.identifier: DBUtils
focal_class.class_method_signature: DBUtils.wrapAsCloseable(final ResultSet resultSet)
focal_class.full_signature: public static Closeable wrapAsCloseable(final ResultSet resultSet)
focal_class.identifier: wrapAsCloseable
focal_class.modifiers: public static
focal_class.parameters: (final ResultSet resultSet)
focal_class.return: Closeable
focal_class.signature: Closeable wrapAsCloseable(final ResultSet resultSet)
focal_class.class_method_signature: DBUtils.setAutoCommit(final Connection connection, final boolean value)
focal_class.full_signature: public static boolean setAutoCommit(final Connection connection, final boolean value)
focal_class.identifier: setAutoCommit
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection, final boolean value)
focal_class.return: boolean
focal_class.signature: boolean setAutoCommit(final Connection connection, final boolean value)
focal_class.class_method_signature: DBUtils.commit(final Connection connection)
focal_class.full_signature: public static void commit(final Connection connection)
focal_class.identifier: commit
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection)
focal_class.return: void
focal_class.signature: void commit(final Connection connection)
focal_class.class_method_signature: DBUtils.rollback(final Connection connection)
focal_class.full_signature: public static boolean rollback(final Connection connection)
focal_class.identifier: rollback
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection)
focal_class.return: boolean
focal_class.signature: boolean rollback(final Connection connection)
focal_class.class_method_signature: DBUtils.closeQuietly(java.sql.ResultSet resultSet)
focal_class.full_signature: public static void closeQuietly(java.sql.ResultSet resultSet)
focal_class.identifier: closeQuietly
focal_class.modifiers: public static
focal_class.parameters: (java.sql.ResultSet resultSet)
focal_class.return: void
focal_class.signature: void closeQuietly(java.sql.ResultSet resultSet)
focal_class.class_method_signature: DBUtils.closeQuietly(Statement statement)
focal_class.full_signature: public static void closeQuietly(Statement statement)
focal_class.identifier: closeQuietly
focal_class.modifiers: public static
focal_class.parameters: (Statement statement)
focal_class.return: void
focal_class.signature: void closeQuietly(Statement statement)
focal_class.class_method_signature: DBUtils.closeQuietly(Connection connection)
focal_class.full_signature: public static void closeQuietly(Connection connection)
focal_class.identifier: closeQuietly
focal_class.modifiers: public static
focal_class.parameters: (Connection connection)
focal_class.return: void
focal_class.signature: void closeQuietly(Connection connection)
focal_class.class_method_signature: DBUtils.getDBTypeForClass(final Class<?> valueType)
focal_class.full_signature: public static String getDBTypeForClass(final Class<?> valueType)
focal_class.identifier: getDBTypeForClass
focal_class.modifiers: public static
focal_class.parameters: (final Class<?> valueType)
focal_class.return: String
focal_class.signature: String getDBTypeForClass(final Class<?> valueType)
focal_class.class_method_signature: DBUtils.setValueToPreparedStatement(int index, final PreparedStatement preparedStatement, Object value)
focal_class.full_signature: public static void setValueToPreparedStatement(int index, final PreparedStatement preparedStatement, Object value)
focal_class.identifier: setValueToPreparedStatement
focal_class.modifiers: public static
focal_class.parameters: (int index, final PreparedStatement preparedStatement, Object value)
focal_class.return: void
focal_class.signature: void setValueToPreparedStatement(int index, final PreparedStatement preparedStatement, Object value)
focal_class.class_method_signature: DBUtils.setValuesToPreparedStatement(final int startIndex, final PreparedStatement preparedStatement, final Iterable values)
focal_class.full_signature: public static int setValuesToPreparedStatement(final int startIndex, final PreparedStatement preparedStatement, final Iterable values)
focal_class.identifier: setValuesToPreparedStatement
focal_class.modifiers: public static
focal_class.parameters: (final int startIndex, final PreparedStatement preparedStatement, final Iterable values)
focal_class.return: int
focal_class.signature: int setValuesToPreparedStatement(final int startIndex, final PreparedStatement preparedStatement, final Iterable values)
focal_class.class_method_signature: DBUtils.getValueFromResultSet(int index, final ResultSet resultSet, final Class<T> type)
focal_class.full_signature: @SuppressWarnings("unchecked") public static T getValueFromResultSet(int index, final ResultSet resultSet, final Class<T> type)
focal_class.identifier: getValueFromResultSet
focal_class.modifiers: @SuppressWarnings("unchecked") public static
focal_class.parameters: (int index, final ResultSet resultSet, final Class<T> type)
focal_class.return: T
focal_class.signature: T getValueFromResultSet(int index, final ResultSet resultSet, final Class<T> type)
focal_class.class_method_signature: DBUtils.sanitizeForTableName(String input)
focal_class.full_signature: public static String sanitizeForTableName(String input)
focal_class.identifier: sanitizeForTableName
focal_class.modifiers: public static
focal_class.parameters: (String input)
focal_class.return: String
focal_class.signature: String sanitizeForTableName(String input)
focal_method.body: public static void setValueToPreparedStatement(int index, final PreparedStatement preparedStatement, Object value) throws SQLException {
  
          if (value instanceof Date) {
              preparedStatement.setLong(index, ((Date) value).getTime());
  
          }else if(value instanceof CharSequence){
              preparedStatement.setString(index, CharSequences.toString((CharSequence)value));
  
          }else{
              preparedStatement.setObject(index, value);
          }
      }
focal_method.class_method_signature: DBUtils.setValueToPreparedStatement(int index, final PreparedStatement preparedStatement, Object value)
focal_method.full_signature: public static void setValueToPreparedStatement(int index, final PreparedStatement preparedStatement, Object value)
focal_method.identifier: setValueToPreparedStatement
focal_method.invocations: setLong getTime setString toString setObject
focal_method.modifiers: public static
focal_method.parameters: (int index, final PreparedStatement preparedStatement, Object value)
focal_method.return: void
focal_method.signature: void setValueToPreparedStatement(int index, final PreparedStatement preparedStatement, Object value)