Merge lp:~zorba-coders/zorba/bug1109853 into lp:zorba/jdbc-module

Proposed by Rodolfo Ochoa
Status: Merged
Approved by: Chris Hillery
Approved revision: 48
Merged at revision: 46
Proposed branch: lp:~zorba-coders/zorba/bug1109853
Merge into: lp:zorba/jdbc-module
Diff against target: 406 lines (+78/-31)
9 files modified
include/javaids.h (+8/-0)
include/jdbc.h (+1/-0)
include/sqltypes.h (+2/-0)
src/jdbc.xq (+25/-25)
src/jdbc.xq.src/connection/connectionoptions.cpp (+0/-2)
src/jdbc.xq.src/javaids.cpp (+7/-1)
src/jdbc.xq.src/jdbc.cpp (+2/-0)
src/jdbc.xq.src/jsonitemsequence.cpp (+16/-1)
src/jdbc.xq.src/sqltypes.cpp (+17/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug1109853
Reviewer Review Type Date Requested Status
Rodolfo Ochoa Approve
Chris Hillery Approve
Review via email: mp+145525@code.launchpad.net

Commit message

BLOB support added
Fixing error in documentation due line numbering

Description of the change

BLOB support added
Fixing error in documentation due line numbering

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug1109853-2013-01-30T03-42-05.903Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 1 Pending.

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Sorry I added this later, I find out this problem when I was creating the paper.

Revision history for this message
Chris Hillery (ceejatec) wrote :

Unless I'm missing something, the following if condition (and the corresponding block of code) is repeated twice in jsonitemsequence.cpp :

+ } else if (SQLTypes::isString(columnTypes[i])) {

Also, what's the story behind the various new // **** and // ---- comments?

review: Needs Fixing
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug1109853 into lp:zorba/jdbc-module failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug1109853-2013-02-02T06-04-06.016Z is finished. The
  final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug1109853 into lp:zorba/jdbc-module failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug1109853-2013-02-02T14-49-07.197Z is finished. The
  final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug1109853-2013-02-03T10-46-09.123Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/javaids.h'
--- include/javaids.h 2013-01-05 01:04:21 +0000
+++ include/javaids.h 2013-02-02 04:42:22 +0000
@@ -77,6 +77,7 @@
77 jmethodID getInt;77 jmethodID getInt;
78 jmethodID getDouble;78 jmethodID getDouble;
79 jmethodID getString;79 jmethodID getString;
80 jmethodID getBLOB;
80};81};
81class JavaResultSetMetadata {82class JavaResultSetMetadata {
82public:83public:
@@ -120,6 +121,13 @@
120 jmethodID getParameterClassName;121 jmethodID getParameterClassName;
121 jmethodID getParameterType;122 jmethodID getParameterType;
122};123};
124class JavaBlob {
125public:
126 bool init();
127 jclass classID;
128 jmethodID getBytes;
129 jmethodID length;
130};
123131
124132
125}}; // namespace zorba, jdbc133}}; // namespace zorba, jdbc
126134
=== modified file 'include/jdbc.h'
--- include/jdbc.h 2013-01-09 19:41:52 +0000
+++ include/jdbc.h 2013-02-02 04:42:22 +0000
@@ -51,6 +51,7 @@
51extern JavaResultSetMetadata jResultSetMetadata;51extern JavaResultSetMetadata jResultSetMetadata;
52extern JavaPreparedStatement jPreparedStatement;52extern JavaPreparedStatement jPreparedStatement;
53extern JavaParameterMetadata jParameterMetadata;53extern JavaParameterMetadata jParameterMetadata;
54extern JavaBlob jBlob;
54extern bool isOutputJSON;55extern bool isOutputJSON;
5556
56#define CHECK_EXCEPTION if ((lException = env->ExceptionOccurred())) throw JavaException();57#define CHECK_EXCEPTION if ((lException = env->ExceptionOccurred())) throw JavaException();
5758
=== modified file 'include/sqltypes.h'
--- include/sqltypes.h 2012-12-22 14:35:53 +0000
+++ include/sqltypes.h 2013-02-02 04:42:22 +0000
@@ -71,6 +71,8 @@
71 static void init();71 static void init();
72 static bool isInt(long lType);72 static bool isInt(long lType);
73 static bool isFloat(long lType);73 static bool isFloat(long lType);
74 static bool isString(long lType);
75 static bool isBLOB(long lType);
7476
75};77};
7678
7779
=== modified file 'src/jdbc.xq'
--- src/jdbc.xq 2013-01-09 19:59:40 +0000
+++ src/jdbc.xq 2013-02-02 04:42:22 +0000
@@ -57,7 +57,7 @@
57 :)57 :)
5858
59(:~59(:~
60 : 2.1 Opens a connection to a database.60 : Opens a connection to a database.
61 : Returns a URI identifying the connection that has been opened. The implementing code determines from the $connection-config either explicitly (interpreting the driver attribute) or implicitly (using the type attribute) which driver it has to load.61 : Returns a URI identifying the connection that has been opened. The implementing code determines from the $connection-config either explicitly (interpreting the driver attribute) or implicitly (using the type attribute) which driver it has to load.
62 :62 :
63 : @param $connection-config json object that has the host and user informations.63 : @param $connection-config json object that has the host and user informations.
@@ -82,7 +82,7 @@
82 $connection-config as object() ) as xs:anyURI external;82 $connection-config as object() ) as xs:anyURI external;
8383
84(:~84(:~
85 : 2.1 Opens a connection to a database with specified options.85 : Opens a connection to a database with specified options.
86 : Returns a URI identifying the connection that has been opened. The implementing code determines from the $connection-config either explicitly (interpreting the driver attribute) or implicitly (using the type attribute) which driver it has to load.86 : Returns a URI identifying the connection that has been opened. The implementing code determines from the $connection-config either explicitly (interpreting the driver attribute) or implicitly (using the type attribute) which driver it has to load.
87 :87 :
88 : @param $connection-config json object that has the host and user informations.88 : @param $connection-config json object that has the host and user informations.
@@ -121,7 +121,7 @@
121 $options as object()?) as xs:anyURI external;121 $options as object()?) as xs:anyURI external;
122122
123(:~123(:~
124 : 2.2 Verify if a connection is still active.124 : Verify if a connection is still active.
125 :125 :
126 : @param $connection-id The identifier to the connection to be verify.126 : @param $connection-id The identifier to the connection to be verify.
127 :127 :
@@ -134,7 +134,7 @@
134 $connection-id as xs:anyURI) as xs:boolean external;134 $connection-id as xs:anyURI) as xs:boolean external;
135135
136(:~136(:~
137 : 2.3 Returns a set with options for a specified connection.137 : Returns a set with options for a specified connection.
138 :138 :
139 : @param $connection-id The identifier to the connection to be verify.139 : @param $connection-id The identifier to the connection to be verify.
140 :140 :
@@ -158,7 +158,7 @@
158 :)158 :)
159159
160(:~160(:~
161 : 3.1 Commit current transaction from an active connection.161 : Commit current transaction from an active connection.
162 :162 :
163 : @param $connection-id The identifier to the connection to be commited.163 : @param $connection-id The identifier to the connection to be commited.
164 : 164 :
@@ -172,7 +172,7 @@
172 $connection-id as xs:anyURI) as empty-sequence() external;172 $connection-id as xs:anyURI) as empty-sequence() external;
173173
174(:~174(:~
175 : 3.2 Rollback the current transaction of a connection.175 : Rollback the current transaction of a connection.
176 :176 :
177 : @param $connection-id The identifier to the connection to be rollbacked.177 : @param $connection-id The identifier to the connection to be rollbacked.
178 :178 :
@@ -191,7 +191,7 @@
191 :)191 :)
192192
193(:~193(:~
194 : 4.1 Executes any kind of SQL statement. 194 : Executes any kind of SQL statement.
195 :195 :
196 : @param $connection-id The identifier to an active connection.196 : @param $connection-id The identifier to an active connection.
197 : @param $sql The query string to be executed.197 : @param $sql The query string to be executed.
@@ -207,7 +207,7 @@
207 $sql as xs:string ) as xs:anyURI external;207 $sql as xs:string ) as xs:anyURI external;
208208
209(:~209(:~
210 : 4.2 Executes non-updating SQL statements.210 : Executes non-updating SQL statements.
211 :211 :
212 : @param $connection-id The identifier to an active connection.212 : @param $connection-id The identifier to an active connection.
213 : @param $sql The query string to be executed.213 : @param $sql The query string to be executed.
@@ -228,7 +228,7 @@
228 $sql as xs:string) as object()* external;228 $sql as xs:string) as object()* external;
229229
230(:~230(:~
231 : 4.3 Executes updating SQL statements.231 : Executes updating SQL statements.
232 :232 :
233 : @param $connection-id The identifier to an active connection.233 : @param $connection-id The identifier to an active connection.
234 : @param $sql The query string to be executed.234 : @param $sql The query string to be executed.
@@ -250,7 +250,7 @@
250 :)250 :)
251251
252(:~252(:~
253 : 5.1 Creates a prepared statement for multiple executions with diferent values.253 : Creates a prepared statement for multiple executions with diferent values.
254 :254 :
255 : @param $connection-id The identifier to an active connection.255 : @param $connection-id The identifier to an active connection.
256 : @param $sql The query string to be executed.256 : @param $sql The query string to be executed.
@@ -269,7 +269,7 @@
269 $sql as xs:string) as xs:anyURI external;269 $sql as xs:string) as xs:anyURI external;
270270
271(:~271(:~
272 : 5.2.1 Set the value of the designated parameter with the given value, this function will assign only numeric values.272 : Set the value of the designated parameter with the given value, this function will assign only numeric values.
273 :273 :
274 : @param $prepared-statement The identifier to a prepared statement.274 : @param $prepared-statement The identifier to a prepared statement.
275 : @param $parameter-index The index from the parameter to be set.275 : @param $parameter-index The index from the parameter to be set.
@@ -288,7 +288,7 @@
288 $value as xs:anyAtomicType) as empty-sequence() external;288 $value as xs:anyAtomicType) as empty-sequence() external;
289289
290(:~290(:~
291 : 5.2.2 Set the value of the designated parameter with the given value, this function will assign only string values.291 : Set the value of the designated parameter with the given value, this function will assign only string values.
292 :292 :
293 : @param $prepared-statement The identifier to a prepared statement.293 : @param $prepared-statement The identifier to a prepared statement.
294 : @param $parameter-index The index from the parameter to be set.294 : @param $parameter-index The index from the parameter to be set.
@@ -307,7 +307,7 @@
307 $value as xs:string) as empty-sequence() external;307 $value as xs:string) as empty-sequence() external;
308308
309(:~309(:~
310 : 5.2.3 Set the value of the designated parameter with the given value, this function will assign only boolean values.310 : Set the value of the designated parameter with the given value, this function will assign only boolean values.
311 :311 :
312 : @param $prepared-statement The identifier to a prepared statement.312 : @param $prepared-statement The identifier to a prepared statement.
313 : @param $parameter-index The index from the parameter to be set.313 : @param $parameter-index The index from the parameter to be set.
@@ -326,7 +326,7 @@
326 $value as xs:boolean) as empty-sequence() external;326 $value as xs:boolean) as empty-sequence() external;
327327
328(:~328(:~
329 : 5.2.4 Set the value of the designated parameter with the given value, this function will assign only null values if possible.329 : Set the value of the designated parameter with the given value, this function will assign only null values if possible.
330 :330 :
331 : @param $prepared-statement The identifier to a prepared statement.331 : @param $prepared-statement The identifier to a prepared statement.
332 : @param $parameter-index The index from the parameter to be set.332 : @param $parameter-index The index from the parameter to be set.
@@ -343,7 +343,7 @@
343 $parameter-index as xs:integer) as empty-sequence() external;343 $parameter-index as xs:integer) as empty-sequence() external;
344344
345(:~345(:~
346 : 5.2.5 Set the value of the designated parameter with the given value, 346 : Set the value of the designated parameter with the given value,
347 : this function will assign any value you send 347 : this function will assign any value you send
348 : and it will try to cast to the correct type.348 : and it will try to cast to the correct type.
349 :349 :
@@ -364,7 +364,7 @@
364 $value as xs:anyAtomicType) as empty-sequence() external;364 $value as xs:anyAtomicType) as empty-sequence() external;
365365
366(:~366(:~
367 : 5.3 Clears the current parameter values immediately.367 : Clears the current parameter values immediately.
368 :368 :
369 : @param $prepared-statement The identifier to a prepared statement.369 : @param $prepared-statement The identifier to a prepared statement.
370 : 370 :
@@ -378,7 +378,7 @@
378 $prepared-statement as xs:anyURI) as empty-sequence() external;378 $prepared-statement as xs:anyURI) as empty-sequence() external;
379379
380(:~380(:~
381 : 5.4 Retrieves the number, types and properties of the prepared statement parameters.381 : Retrieves the number, types and properties of the prepared statement parameters.
382 :382 :
383 : @param $prepared-statement The identifier to a prepared statement.383 : @param $prepared-statement The identifier to a prepared statement.
384 : 384 :
@@ -402,7 +402,7 @@
402 $prepared-statement as xs:anyURI) as object() external;402 $prepared-statement as xs:anyURI) as object() external;
403403
404(:~404(:~
405 : 5.5 Executes SQL statements prepared with 5.1 jsql:prepare-statement with values set405 : Executes SQL statements prepared with 5.1 jsql:prepare-statement with values set
406 : and returns an identifier to a Dataset.406 : and returns an identifier to a Dataset.
407 :407 :
408 : @param $prepared-statement The identifier to a prepared statement.408 : @param $prepared-statement The identifier to a prepared statement.
@@ -417,7 +417,7 @@
417 $prepared-statement as xs:anyURI) as xs:anyURI external;417 $prepared-statement as xs:anyURI) as xs:anyURI external;
418418
419(:~419(:~
420 : 5.6 Executes a non-updating SQL statement prepared with 5.1 jsql:prepare-statement.420 : Executes a non-updating SQL statement prepared with 5.1 jsql:prepare-statement.
421 :421 :
422 : @param $prepared-statement The identifier to a prepared statement.422 : @param $prepared-statement The identifier to a prepared statement.
423 : 423 :
@@ -435,7 +435,7 @@
435 $prepared-statement as xs:anyURI) as object()* external;435 $prepared-statement as xs:anyURI) as object()* external;
436436
437(:~437(:~
438 : 5.7 Executes an updating SQL statement prepared with 5.1 jsql:prepare-statement.438 : Executes an updating SQL statement prepared with 5.1 jsql:prepare-statement.
439 :439 :
440 : @param $prepared-statement The identifier to a prepared statement.440 : @param $prepared-statement The identifier to a prepared statement.
441 : 441 :
@@ -450,7 +450,7 @@
450 $prepared-statement as xs:anyURI) as xs:integer external;450 $prepared-statement as xs:anyURI) as xs:integer external;
451451
452(:~452(:~
453 : 5.8 Closes and frees from memory any prepared SQL statement created with jdbc:prepare-statement453 : Closes and frees from memory any prepared SQL statement created with jdbc:prepare-statement
454 :454 :
455 : @param $prepared-statement The identifier to a prepared statement.455 : @param $prepared-statement The identifier to a prepared statement.
456 : 456 :
@@ -469,7 +469,7 @@
469 :)469 :)
470470
471(:~471(:~
472 : 6.1 This function returns a sequence of objects representing the rows of data from a non-updating query.472 : This function returns a sequence of objects representing the rows of data from a non-updating query.
473 :473 :
474 : @param $dataset-id The identifier to a DataSet.474 : @param $dataset-id The identifier to a DataSet.
475 : 475 :
@@ -486,7 +486,7 @@
486 $dataset-id as xs:anyURI) as object()* external;486 $dataset-id as xs:anyURI) as object()* external;
487487
488(:~488(:~
489 : 6.2 Return the metadata of the result of a particular DataSet.489 : Return the metadata of the result of a particular DataSet.
490 :490 :
491 : @param $dataset-id The identifier to a DataSet.491 : @param $dataset-id The identifier to a DataSet.
492 : 492 :
@@ -517,7 +517,7 @@
517 $dataset-id as xs:anyURI) as object() external;517 $dataset-id as xs:anyURI) as object() external;
518518
519(:~519(:~
520 : 6.3 Return the number of affected rows of a particular DataSet.520 : Return the number of affected rows of a particular DataSet.
521 :521 :
522 : @param $dataset-id The identifier to a DataSet.522 : @param $dataset-id The identifier to a DataSet.
523 : 523 :
@@ -531,7 +531,7 @@
531 $dataset-id as xs:anyURI) as xs:integer external;531 $dataset-id as xs:anyURI) as xs:integer external;
532532
533(:~533(:~
534 : 6.4 Closes and free resources from a particular DataSet.534 : Closes and free resources from a particular DataSet.
535 :535 :
536 : @param $dataset-id The identifier to a DataSet.536 : @param $dataset-id The identifier to a DataSet.
537 : 537 :
538538
=== modified file 'src/jdbc.xq.src/connection/connectionoptions.cpp'
--- src/jdbc.xq.src/connection/connectionoptions.cpp 2012-12-27 22:13:59 +0000
+++ src/jdbc.xq.src/connection/connectionoptions.cpp 2013-02-02 04:42:22 +0000
@@ -67,6 +67,4 @@
67 return ItemSequence_t(new SingletonItemSequence(result));67 return ItemSequence_t(new SingletonItemSequence(result));
68}68}
6969
70
71
72}}; // namespace zorba, jdbc70}}; // namespace zorba, jdbc
7371
=== modified file 'src/jdbc.xq.src/javaids.cpp'
--- src/jdbc.xq.src/javaids.cpp 2013-01-05 01:04:21 +0000
+++ src/jdbc.xq.src/javaids.cpp 2013-02-02 04:42:22 +0000
@@ -70,6 +70,7 @@
70 getInt = env->GetMethodID(classID, "getInt", "(I)I");70 getInt = env->GetMethodID(classID, "getInt", "(I)I");
71 getDouble = env->GetMethodID(classID, "getDouble", "(I)D");71 getDouble = env->GetMethodID(classID, "getDouble", "(I)D");
72 getString = env->GetMethodID(classID, "getString", "(I)Ljava/lang/String;");72 getString = env->GetMethodID(classID, "getString", "(I)Ljava/lang/String;");
73 getBLOB = env->GetMethodID(classID, "getBlob", "(I)Ljava/sql/Blob;");
73 return true;74 return true;
74 }75 }
75 bool JavaResultSetMetadata::init() {76 bool JavaResultSetMetadata::init() {
@@ -111,7 +112,12 @@
111 getParameterType = env->GetMethodID(classID, "getParameterType", "(I)I");112 getParameterType = env->GetMethodID(classID, "getParameterType", "(I)I");
112 return true;113 return true;
113 }114 }
114115 bool JavaBlob::init() {
116 classID = env->FindClass("java/sql/Blob");
117 getBytes = env->GetMethodID(classID, "getBytes", "(JI)[B");
118 length = env->GetMethodID(classID, "length", "()J");
119 return true;
120 }
115121
116}}; // namespace zorba, jdbc122}}; // namespace zorba, jdbc
117123
118124
=== modified file 'src/jdbc.xq.src/jdbc.cpp'
--- src/jdbc.xq.src/jdbc.cpp 2013-01-09 22:41:07 +0000
+++ src/jdbc.xq.src/jdbc.cpp 2013-02-02 04:42:22 +0000
@@ -69,6 +69,7 @@
69JavaResultSetMetadata jResultSetMetadata;69JavaResultSetMetadata jResultSetMetadata;
70JavaPreparedStatement jPreparedStatement;70JavaPreparedStatement jPreparedStatement;
71JavaParameterMetadata jParameterMetadata;71JavaParameterMetadata jParameterMetadata;
72JavaBlob jBlob;
72bool isOutputJSON = true;73bool isOutputJSON = true;
7374
74zorba::ExternalFunction* 75zorba::ExternalFunction*
@@ -333,6 +334,7 @@
333 jResultSetMetadata.init();334 jResultSetMetadata.init();
334 jPreparedStatement.init();335 jPreparedStatement.init();
335 jParameterMetadata.init();336 jParameterMetadata.init();
337 jBlob.init();
336 SQLTypes::init();338 SQLTypes::init();
337 JDBC_MODULE_CATCH339 JDBC_MODULE_CATCH
338}340}
339341
=== modified file 'src/jdbc.xq.src/jsonitemsequence.cpp'
--- src/jdbc.xq.src/jsonitemsequence.cpp 2012-12-30 14:54:17 +0000
+++ src/jdbc.xq.src/jsonitemsequence.cpp 2013-02-02 04:42:22 +0000
@@ -78,7 +78,7 @@
78 double value = env->CallDoubleMethod(oResultSet, jResultSet.getDouble, i+1);78 double value = env->CallDoubleMethod(oResultSet, jResultSet.getDouble, i+1);
79 CHECK_EXCEPTION79 CHECK_EXCEPTION
80 aValue = itemFactory->createDouble(value);80 aValue = itemFactory->createDouble(value);
81 } else {81 } else if (SQLTypes::isString(columnTypes[i])) {
82 jstring sValue = (jstring) env->CallObjectMethod(oResultSet, jResultSet.getString, i+1);82 jstring sValue = (jstring) env->CallObjectMethod(oResultSet, jResultSet.getString, i+1);
83 CHECK_EXCEPTION83 CHECK_EXCEPTION
84 if (sValue!=NULL) {84 if (sValue!=NULL) {
@@ -89,6 +89,21 @@
89 } else {89 } else {
90 aValue = itemFactory->createJSONNull();90 aValue = itemFactory->createJSONNull();
91 }91 }
92 } else if (SQLTypes::isBLOB(columnTypes[i])) {
93 jobject oBlob = env->CallObjectMethod(oResultSet, jResultSet.getBLOB, i+1);
94 CHECK_EXCEPTION
95 if (oBlob!=NULL) {
96 jint length = env->CallIntMethod(oBlob, jBlob.length);
97 CHECK_EXCEPTION
98 jbyteArray bytes = (jbyteArray) env->CallObjectMethod(oBlob, jBlob.getBytes, 1, length);
99 CHECK_EXCEPTION
100 const char* byteString = (const char*)(env->GetByteArrayElements(bytes, 0));
101 aValue = itemFactory->createBase64Binary(byteString, length);
102 } else {
103 aValue = itemFactory->createJSONNull();
104 }
105 } else if (columnTypes[i]==SQLTypes::_NULL) {
106 aValue = itemFactory->createJSONNull();
92 }107 }
93 elements.push_back(std::pair<zorba::Item, zorba::Item>(aKey, aValue));108 elements.push_back(std::pair<zorba::Item, zorba::Item>(aKey, aValue));
94 }109 }
95110
=== modified file 'src/jdbc.xq.src/sqltypes.cpp'
--- src/jdbc.xq.src/sqltypes.cpp 2012-12-24 01:58:02 +0000
+++ src/jdbc.xq.src/sqltypes.cpp 2013-02-02 04:42:22 +0000
@@ -101,13 +101,28 @@
101 VARCHAR = env->GetStaticIntField(cTypes, env->GetStaticFieldID(cTypes, "VARCHAR", "I"));101 VARCHAR = env->GetStaticIntField(cTypes, env->GetStaticFieldID(cTypes, "VARCHAR", "I"));
102}102}
103103
104bool SQLTypes::isBLOB(long lType) {
105 return (
106 (lType == BINARY) || (lType == BLOB) || (lType==LONGVARBINARY) || (lType==VARBINARY) ||
107 (lType == ARRAY) || (lType == DATALINK) || (lType==JAVA_OBJECT) || (lType==OTHER) ||
108 (lType == REF)
109 );
110}
111
112bool SQLTypes::isString(long lType) {
113 return (
114 (lType == CHAR) || (lType == CLOB) || (lType == LONGVARCHAR) || (lType==LONGNVARCHAR) ||
115 (lType==NCHAR) || (lType==NCLOB) || (lType==NVARCHAR) || (lType==VARCHAR) ||
116 (lType==DATE) || (lType==TIME) || (lType==TIMESTAMP) || (lType==SQLXML)
117 );
118}
119
104bool SQLTypes::isInt(long lType){120bool SQLTypes::isInt(long lType){
105 return ( (lType == INTEGER) || (lType==BIGINT) || (lType==TINYINT) || (lType==BIT) );121 return ( (lType == INTEGER) || (lType==BIGINT) || (lType==TINYINT) || (lType==SMALLINT) || (lType==BIT) );
106}122}
107123
108bool SQLTypes::isFloat(long lType){124bool SQLTypes::isFloat(long lType){
109 return ((lType == DECIMAL) || (lType==DOUBLE) || (lType==FLOAT) || (lType==NUMERIC) || (lType==REAL) );125 return ((lType == DECIMAL) || (lType==DOUBLE) || (lType==FLOAT) || (lType==NUMERIC) || (lType==REAL) );
110}126}
111127
112
113}}; // namespace zorba, jdbc128}}; // namespace zorba, jdbc

Subscribers

People subscribed via source and target branches

to all changes: