Permalink
Browse files

[jdbc-driver] Set opaque parameter as JDBC OTHER

  • Loading branch information...
cchantep
cchantep committed Mar 18, 2016
1 parent 48f5695 commit 40bfcf737112b166f2d7c2d4d56791d15178b90f
View
@@ -1,6 +1,6 @@
language: scala
jdk:
- openjdk6
- openjdk7
- oraclejdk8
env: JAVA_OPTS="-Xms32m -Xmx128m"
before_install:
@@ -81,6 +81,7 @@
mappings.put(Types.VARBINARY, byte[].class.getName());
mappings.put(Types.LONGVARBINARY, byte[].class.getName());
mappings.put(Types.BLOB, java.sql.Blob.class.getName());
mappings.put(Types.OTHER, Object.class.getName());
jdbcTypeMappings = Collections.unmodifiableMap(mappings);
@@ -125,6 +126,7 @@
names.put(Types.VARBINARY, "VARBINARY");
names.put(Types.LONGVARBINARY, "LONGVARBINARY");
names.put(Types.BLOB, "BLOB");
names.put(Types.OTHER, "OTHER");
jdbcTypeNames = Collections.unmodifiableMap(names);
@@ -162,6 +164,7 @@
signs.put(Types.VARBINARY, Boolean.FALSE);
signs.put(Types.LONGVARBINARY, Boolean.FALSE);
signs.put(Types.BLOB, Boolean.FALSE);
signs.put(Types.OTHER, Boolean.FALSE);
jdbcTypeSigns = Collections.unmodifiableMap(signs);
@@ -191,6 +194,7 @@
precisions.put(Types.VARBINARY, 0);
precisions.put(Types.LONGVARBINARY, 0);
precisions.put(Types.BLOB, 0);
precisions.put(Types.OTHER, 0);
jdbcTypePrecisions = Collections.unmodifiableMap(precisions);
@@ -219,6 +223,7 @@
scales.put(Types.VARBINARY, 0);
scales.put(Types.LONGVARBINARY, 0);
scales.put(Types.BLOB, 0);
scales.put(Types.OTHER, 0);
jdbcTypeScales = Collections.unmodifiableMap(scales);
} // end of <cinit>
@@ -1439,6 +1439,21 @@ trait StatementSpecification[S <: PreparedStatement] extends Setters {
}
}
"Unknown value" should {
"be set as OTHER object" in {
val v = new AnyRef {}
val s = statement()
s.setObject(1, v, Types.OTHER)
lazy val m = s.getParameterMetaData
(m.getParameterCount aka "count" mustEqual 1).
and(m.getParameterType(1) aka "first type" mustEqual Types.OTHER)
}
}
"Parameters" should {
"be kept in order when not set orderly" in {
lazy val s = statement()

0 comments on commit 40bfcf7

Please sign in to comment.