示例#1
0
 private void testResultSetOperation(Object obj) throws SQLException {
   SimpleResultSet rs = new SimpleResultSet();
   rs.setAutoClose(false);
   int valueType = DataType.getTypeFromClass(obj.getClass());
   int sqlType = DataType.convertTypeToSQLType(valueType);
   rs.addColumn("X", sqlType, 10, 0);
   rs.addRow(new Object[] {obj});
   rs.next();
   Value v = DataType.readValue(null, rs, 1, valueType);
   Value v2 = DataType.convertToValue(null, obj, valueType);
   if (v.getType() == Value.RESULT_SET) {
     assertEquals(v.toString(), v2.toString());
   } else {
     assertTrue(v.equals(v2));
   }
 }
示例#2
0
 /**
  * Remember that the given LOB value must be un-linked (disconnected from the table) at commit.
  *
  * @param v the value
  */
 public void unlinkAtCommit(Value v) {
   if (SysProperties.CHECK && !v.isLinked()) {
     DbException.throwInternalError();
   }
   if (unlinkLobMap == null) {
     unlinkLobMap = New.hashMap();
   }
   unlinkLobMap.put(v.toString(), v);
 }
示例#3
0
 /**
  * Do not remove this LOB value at commit any longer.
  *
  * @param v the value
  */
 public void removeAtCommitStop(Value v) {
   if (removeLobMap != null) {
     removeLobMap.remove(v.toString());
   }
 }
示例#4
0
 /**
  * Do not unlink this LOB value at commit any longer.
  *
  * @param v the value
  */
 public void unlinkAtCommitStop(Value v) {
   if (unlinkLobMap != null) {
     unlinkLobMap.remove(v.toString());
   }
 }