Merge lp:~zorba-coders/zorba/bug1109853 into lp:zorba/jdbc-module
- bug1109853
- Merge into jdbc-module
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 | ||||
Related bugs: |
|
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
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug1109853-2013-01-
All tests succeeded!
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.
Rodolfo Ochoa (rodolfo-ochoa) wrote : | # |
Sorry I added this later, I find out this problem when I was creating the paper.
Chris Hillery (ceejatec) wrote : | # |
Unless I'm missing something, the following if condition (and the corresponding block of code) is repeated twice in jsonitemsequenc
+ } else if (SQLTypes:
Also, what's the story behind the various new // **** and // ---- comments?
Chris Hillery (ceejatec) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
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/
Validation queue job bug1109853-2013-02-
final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Rodolfo Ochoa (rodolfo-ochoa) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
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/
Validation queue job bug1109853-2013-02-
final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug1109853-2013-02-
All tests succeeded!
Preview Diff
1 | === modified file 'include/javaids.h' | |||
2 | --- include/javaids.h 2013-01-05 01:04:21 +0000 | |||
3 | +++ include/javaids.h 2013-02-02 04:42:22 +0000 | |||
4 | @@ -77,6 +77,7 @@ | |||
5 | 77 | jmethodID getInt; | 77 | jmethodID getInt; |
6 | 78 | jmethodID getDouble; | 78 | jmethodID getDouble; |
7 | 79 | jmethodID getString; | 79 | jmethodID getString; |
8 | 80 | jmethodID getBLOB; | ||
9 | 80 | }; | 81 | }; |
10 | 81 | class JavaResultSetMetadata { | 82 | class JavaResultSetMetadata { |
11 | 82 | public: | 83 | public: |
12 | @@ -120,6 +121,13 @@ | |||
13 | 120 | jmethodID getParameterClassName; | 121 | jmethodID getParameterClassName; |
14 | 121 | jmethodID getParameterType; | 122 | jmethodID getParameterType; |
15 | 122 | }; | 123 | }; |
16 | 124 | class JavaBlob { | ||
17 | 125 | public: | ||
18 | 126 | bool init(); | ||
19 | 127 | jclass classID; | ||
20 | 128 | jmethodID getBytes; | ||
21 | 129 | jmethodID length; | ||
22 | 130 | }; | ||
23 | 123 | 131 | ||
24 | 124 | 132 | ||
25 | 125 | }}; // namespace zorba, jdbc | 133 | }}; // namespace zorba, jdbc |
26 | 126 | 134 | ||
27 | === modified file 'include/jdbc.h' | |||
28 | --- include/jdbc.h 2013-01-09 19:41:52 +0000 | |||
29 | +++ include/jdbc.h 2013-02-02 04:42:22 +0000 | |||
30 | @@ -51,6 +51,7 @@ | |||
31 | 51 | extern JavaResultSetMetadata jResultSetMetadata; | 51 | extern JavaResultSetMetadata jResultSetMetadata; |
32 | 52 | extern JavaPreparedStatement jPreparedStatement; | 52 | extern JavaPreparedStatement jPreparedStatement; |
33 | 53 | extern JavaParameterMetadata jParameterMetadata; | 53 | extern JavaParameterMetadata jParameterMetadata; |
34 | 54 | extern JavaBlob jBlob; | ||
35 | 54 | extern bool isOutputJSON; | 55 | extern bool isOutputJSON; |
36 | 55 | 56 | ||
37 | 56 | #define CHECK_EXCEPTION if ((lException = env->ExceptionOccurred())) throw JavaException(); | 57 | #define CHECK_EXCEPTION if ((lException = env->ExceptionOccurred())) throw JavaException(); |
38 | 57 | 58 | ||
39 | === modified file 'include/sqltypes.h' | |||
40 | --- include/sqltypes.h 2012-12-22 14:35:53 +0000 | |||
41 | +++ include/sqltypes.h 2013-02-02 04:42:22 +0000 | |||
42 | @@ -71,6 +71,8 @@ | |||
43 | 71 | static void init(); | 71 | static void init(); |
44 | 72 | static bool isInt(long lType); | 72 | static bool isInt(long lType); |
45 | 73 | static bool isFloat(long lType); | 73 | static bool isFloat(long lType); |
46 | 74 | static bool isString(long lType); | ||
47 | 75 | static bool isBLOB(long lType); | ||
48 | 74 | 76 | ||
49 | 75 | }; | 77 | }; |
50 | 76 | 78 | ||
51 | 77 | 79 | ||
52 | === modified file 'src/jdbc.xq' | |||
53 | --- src/jdbc.xq 2013-01-09 19:59:40 +0000 | |||
54 | +++ src/jdbc.xq 2013-02-02 04:42:22 +0000 | |||
55 | @@ -57,7 +57,7 @@ | |||
56 | 57 | :) | 57 | :) |
57 | 58 | 58 | ||
58 | 59 | (:~ | 59 | (:~ |
60 | 60 | : 2.1 Opens a connection to a database. | 60 | : Opens a connection to a database. |
61 | 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 | : | 62 | : |
63 | 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. |
64 | @@ -82,7 +82,7 @@ | |||
65 | 82 | $connection-config as object() ) as xs:anyURI external; | 82 | $connection-config as object() ) as xs:anyURI external; |
66 | 83 | 83 | ||
67 | 84 | (:~ | 84 | (:~ |
69 | 85 | : 2.1 Opens a connection to a database with specified options. | 85 | : Opens a connection to a database with specified options. |
70 | 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. |
71 | 87 | : | 87 | : |
72 | 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. |
73 | @@ -121,7 +121,7 @@ | |||
74 | 121 | $options as object()?) as xs:anyURI external; | 121 | $options as object()?) as xs:anyURI external; |
75 | 122 | 122 | ||
76 | 123 | (:~ | 123 | (:~ |
78 | 124 | : 2.2 Verify if a connection is still active. | 124 | : Verify if a connection is still active. |
79 | 125 | : | 125 | : |
80 | 126 | : @param $connection-id The identifier to the connection to be verify. | 126 | : @param $connection-id The identifier to the connection to be verify. |
81 | 127 | : | 127 | : |
82 | @@ -134,7 +134,7 @@ | |||
83 | 134 | $connection-id as xs:anyURI) as xs:boolean external; | 134 | $connection-id as xs:anyURI) as xs:boolean external; |
84 | 135 | 135 | ||
85 | 136 | (:~ | 136 | (:~ |
87 | 137 | : 2.3 Returns a set with options for a specified connection. | 137 | : Returns a set with options for a specified connection. |
88 | 138 | : | 138 | : |
89 | 139 | : @param $connection-id The identifier to the connection to be verify. | 139 | : @param $connection-id The identifier to the connection to be verify. |
90 | 140 | : | 140 | : |
91 | @@ -158,7 +158,7 @@ | |||
92 | 158 | :) | 158 | :) |
93 | 159 | 159 | ||
94 | 160 | (:~ | 160 | (:~ |
96 | 161 | : 3.1 Commit current transaction from an active connection. | 161 | : Commit current transaction from an active connection. |
97 | 162 | : | 162 | : |
98 | 163 | : @param $connection-id The identifier to the connection to be commited. | 163 | : @param $connection-id The identifier to the connection to be commited. |
99 | 164 | : | 164 | : |
100 | @@ -172,7 +172,7 @@ | |||
101 | 172 | $connection-id as xs:anyURI) as empty-sequence() external; | 172 | $connection-id as xs:anyURI) as empty-sequence() external; |
102 | 173 | 173 | ||
103 | 174 | (:~ | 174 | (:~ |
105 | 175 | : 3.2 Rollback the current transaction of a connection. | 175 | : Rollback the current transaction of a connection. |
106 | 176 | : | 176 | : |
107 | 177 | : @param $connection-id The identifier to the connection to be rollbacked. | 177 | : @param $connection-id The identifier to the connection to be rollbacked. |
108 | 178 | : | 178 | : |
109 | @@ -191,7 +191,7 @@ | |||
110 | 191 | :) | 191 | :) |
111 | 192 | 192 | ||
112 | 193 | (:~ | 193 | (:~ |
114 | 194 | : 4.1 Executes any kind of SQL statement. | 194 | : Executes any kind of SQL statement. |
115 | 195 | : | 195 | : |
116 | 196 | : @param $connection-id The identifier to an active connection. | 196 | : @param $connection-id The identifier to an active connection. |
117 | 197 | : @param $sql The query string to be executed. | 197 | : @param $sql The query string to be executed. |
118 | @@ -207,7 +207,7 @@ | |||
119 | 207 | $sql as xs:string ) as xs:anyURI external; | 207 | $sql as xs:string ) as xs:anyURI external; |
120 | 208 | 208 | ||
121 | 209 | (:~ | 209 | (:~ |
123 | 210 | : 4.2 Executes non-updating SQL statements. | 210 | : Executes non-updating SQL statements. |
124 | 211 | : | 211 | : |
125 | 212 | : @param $connection-id The identifier to an active connection. | 212 | : @param $connection-id The identifier to an active connection. |
126 | 213 | : @param $sql The query string to be executed. | 213 | : @param $sql The query string to be executed. |
127 | @@ -228,7 +228,7 @@ | |||
128 | 228 | $sql as xs:string) as object()* external; | 228 | $sql as xs:string) as object()* external; |
129 | 229 | 229 | ||
130 | 230 | (:~ | 230 | (:~ |
132 | 231 | : 4.3 Executes updating SQL statements. | 231 | : Executes updating SQL statements. |
133 | 232 | : | 232 | : |
134 | 233 | : @param $connection-id The identifier to an active connection. | 233 | : @param $connection-id The identifier to an active connection. |
135 | 234 | : @param $sql The query string to be executed. | 234 | : @param $sql The query string to be executed. |
136 | @@ -250,7 +250,7 @@ | |||
137 | 250 | :) | 250 | :) |
138 | 251 | 251 | ||
139 | 252 | (:~ | 252 | (:~ |
141 | 253 | : 5.1 Creates a prepared statement for multiple executions with diferent values. | 253 | : Creates a prepared statement for multiple executions with diferent values. |
142 | 254 | : | 254 | : |
143 | 255 | : @param $connection-id The identifier to an active connection. | 255 | : @param $connection-id The identifier to an active connection. |
144 | 256 | : @param $sql The query string to be executed. | 256 | : @param $sql The query string to be executed. |
145 | @@ -269,7 +269,7 @@ | |||
146 | 269 | $sql as xs:string) as xs:anyURI external; | 269 | $sql as xs:string) as xs:anyURI external; |
147 | 270 | 270 | ||
148 | 271 | (:~ | 271 | (:~ |
150 | 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. |
151 | 273 | : | 273 | : |
152 | 274 | : @param $prepared-statement The identifier to a prepared statement. | 274 | : @param $prepared-statement The identifier to a prepared statement. |
153 | 275 | : @param $parameter-index The index from the parameter to be set. | 275 | : @param $parameter-index The index from the parameter to be set. |
154 | @@ -288,7 +288,7 @@ | |||
155 | 288 | $value as xs:anyAtomicType) as empty-sequence() external; | 288 | $value as xs:anyAtomicType) as empty-sequence() external; |
156 | 289 | 289 | ||
157 | 290 | (:~ | 290 | (:~ |
159 | 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. |
160 | 292 | : | 292 | : |
161 | 293 | : @param $prepared-statement The identifier to a prepared statement. | 293 | : @param $prepared-statement The identifier to a prepared statement. |
162 | 294 | : @param $parameter-index The index from the parameter to be set. | 294 | : @param $parameter-index The index from the parameter to be set. |
163 | @@ -307,7 +307,7 @@ | |||
164 | 307 | $value as xs:string) as empty-sequence() external; | 307 | $value as xs:string) as empty-sequence() external; |
165 | 308 | 308 | ||
166 | 309 | (:~ | 309 | (:~ |
168 | 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. |
169 | 311 | : | 311 | : |
170 | 312 | : @param $prepared-statement The identifier to a prepared statement. | 312 | : @param $prepared-statement The identifier to a prepared statement. |
171 | 313 | : @param $parameter-index The index from the parameter to be set. | 313 | : @param $parameter-index The index from the parameter to be set. |
172 | @@ -326,7 +326,7 @@ | |||
173 | 326 | $value as xs:boolean) as empty-sequence() external; | 326 | $value as xs:boolean) as empty-sequence() external; |
174 | 327 | 327 | ||
175 | 328 | (:~ | 328 | (:~ |
177 | 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. |
178 | 330 | : | 330 | : |
179 | 331 | : @param $prepared-statement The identifier to a prepared statement. | 331 | : @param $prepared-statement The identifier to a prepared statement. |
180 | 332 | : @param $parameter-index The index from the parameter to be set. | 332 | : @param $parameter-index The index from the parameter to be set. |
181 | @@ -343,7 +343,7 @@ | |||
182 | 343 | $parameter-index as xs:integer) as empty-sequence() external; | 343 | $parameter-index as xs:integer) as empty-sequence() external; |
183 | 344 | 344 | ||
184 | 345 | (:~ | 345 | (:~ |
186 | 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, |
187 | 347 | : this function will assign any value you send | 347 | : this function will assign any value you send |
188 | 348 | : and it will try to cast to the correct type. | 348 | : and it will try to cast to the correct type. |
189 | 349 | : | 349 | : |
190 | @@ -364,7 +364,7 @@ | |||
191 | 364 | $value as xs:anyAtomicType) as empty-sequence() external; | 364 | $value as xs:anyAtomicType) as empty-sequence() external; |
192 | 365 | 365 | ||
193 | 366 | (:~ | 366 | (:~ |
195 | 367 | : 5.3 Clears the current parameter values immediately. | 367 | : Clears the current parameter values immediately. |
196 | 368 | : | 368 | : |
197 | 369 | : @param $prepared-statement The identifier to a prepared statement. | 369 | : @param $prepared-statement The identifier to a prepared statement. |
198 | 370 | : | 370 | : |
199 | @@ -378,7 +378,7 @@ | |||
200 | 378 | $prepared-statement as xs:anyURI) as empty-sequence() external; | 378 | $prepared-statement as xs:anyURI) as empty-sequence() external; |
201 | 379 | 379 | ||
202 | 380 | (:~ | 380 | (:~ |
204 | 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. |
205 | 382 | : | 382 | : |
206 | 383 | : @param $prepared-statement The identifier to a prepared statement. | 383 | : @param $prepared-statement The identifier to a prepared statement. |
207 | 384 | : | 384 | : |
208 | @@ -402,7 +402,7 @@ | |||
209 | 402 | $prepared-statement as xs:anyURI) as object() external; | 402 | $prepared-statement as xs:anyURI) as object() external; |
210 | 403 | 403 | ||
211 | 404 | (:~ | 404 | (:~ |
213 | 405 | : 5.5 Executes SQL statements prepared with 5.1 jsql:prepare-statement with values set | 405 | : Executes SQL statements prepared with 5.1 jsql:prepare-statement with values set |
214 | 406 | : and returns an identifier to a Dataset. | 406 | : and returns an identifier to a Dataset. |
215 | 407 | : | 407 | : |
216 | 408 | : @param $prepared-statement The identifier to a prepared statement. | 408 | : @param $prepared-statement The identifier to a prepared statement. |
217 | @@ -417,7 +417,7 @@ | |||
218 | 417 | $prepared-statement as xs:anyURI) as xs:anyURI external; | 417 | $prepared-statement as xs:anyURI) as xs:anyURI external; |
219 | 418 | 418 | ||
220 | 419 | (:~ | 419 | (:~ |
222 | 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. |
223 | 421 | : | 421 | : |
224 | 422 | : @param $prepared-statement The identifier to a prepared statement. | 422 | : @param $prepared-statement The identifier to a prepared statement. |
225 | 423 | : | 423 | : |
226 | @@ -435,7 +435,7 @@ | |||
227 | 435 | $prepared-statement as xs:anyURI) as object()* external; | 435 | $prepared-statement as xs:anyURI) as object()* external; |
228 | 436 | 436 | ||
229 | 437 | (:~ | 437 | (:~ |
231 | 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. |
232 | 439 | : | 439 | : |
233 | 440 | : @param $prepared-statement The identifier to a prepared statement. | 440 | : @param $prepared-statement The identifier to a prepared statement. |
234 | 441 | : | 441 | : |
235 | @@ -450,7 +450,7 @@ | |||
236 | 450 | $prepared-statement as xs:anyURI) as xs:integer external; | 450 | $prepared-statement as xs:anyURI) as xs:integer external; |
237 | 451 | 451 | ||
238 | 452 | (:~ | 452 | (:~ |
240 | 453 | : 5.8 Closes and frees from memory any prepared SQL statement created with jdbc:prepare-statement | 453 | : Closes and frees from memory any prepared SQL statement created with jdbc:prepare-statement |
241 | 454 | : | 454 | : |
242 | 455 | : @param $prepared-statement The identifier to a prepared statement. | 455 | : @param $prepared-statement The identifier to a prepared statement. |
243 | 456 | : | 456 | : |
244 | @@ -469,7 +469,7 @@ | |||
245 | 469 | :) | 469 | :) |
246 | 470 | 470 | ||
247 | 471 | (:~ | 471 | (:~ |
249 | 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. |
250 | 473 | : | 473 | : |
251 | 474 | : @param $dataset-id The identifier to a DataSet. | 474 | : @param $dataset-id The identifier to a DataSet. |
252 | 475 | : | 475 | : |
253 | @@ -486,7 +486,7 @@ | |||
254 | 486 | $dataset-id as xs:anyURI) as object()* external; | 486 | $dataset-id as xs:anyURI) as object()* external; |
255 | 487 | 487 | ||
256 | 488 | (:~ | 488 | (:~ |
258 | 489 | : 6.2 Return the metadata of the result of a particular DataSet. | 489 | : Return the metadata of the result of a particular DataSet. |
259 | 490 | : | 490 | : |
260 | 491 | : @param $dataset-id The identifier to a DataSet. | 491 | : @param $dataset-id The identifier to a DataSet. |
261 | 492 | : | 492 | : |
262 | @@ -517,7 +517,7 @@ | |||
263 | 517 | $dataset-id as xs:anyURI) as object() external; | 517 | $dataset-id as xs:anyURI) as object() external; |
264 | 518 | 518 | ||
265 | 519 | (:~ | 519 | (:~ |
267 | 520 | : 6.3 Return the number of affected rows of a particular DataSet. | 520 | : Return the number of affected rows of a particular DataSet. |
268 | 521 | : | 521 | : |
269 | 522 | : @param $dataset-id The identifier to a DataSet. | 522 | : @param $dataset-id The identifier to a DataSet. |
270 | 523 | : | 523 | : |
271 | @@ -531,7 +531,7 @@ | |||
272 | 531 | $dataset-id as xs:anyURI) as xs:integer external; | 531 | $dataset-id as xs:anyURI) as xs:integer external; |
273 | 532 | 532 | ||
274 | 533 | (:~ | 533 | (:~ |
276 | 534 | : 6.4 Closes and free resources from a particular DataSet. | 534 | : Closes and free resources from a particular DataSet. |
277 | 535 | : | 535 | : |
278 | 536 | : @param $dataset-id The identifier to a DataSet. | 536 | : @param $dataset-id The identifier to a DataSet. |
279 | 537 | : | 537 | : |
280 | 538 | 538 | ||
281 | === modified file 'src/jdbc.xq.src/connection/connectionoptions.cpp' | |||
282 | --- src/jdbc.xq.src/connection/connectionoptions.cpp 2012-12-27 22:13:59 +0000 | |||
283 | +++ src/jdbc.xq.src/connection/connectionoptions.cpp 2013-02-02 04:42:22 +0000 | |||
284 | @@ -67,6 +67,4 @@ | |||
285 | 67 | return ItemSequence_t(new SingletonItemSequence(result)); | 67 | return ItemSequence_t(new SingletonItemSequence(result)); |
286 | 68 | } | 68 | } |
287 | 69 | 69 | ||
288 | 70 | |||
289 | 71 | |||
290 | 72 | }}; // namespace zorba, jdbc | 70 | }}; // namespace zorba, jdbc |
291 | 73 | 71 | ||
292 | === modified file 'src/jdbc.xq.src/javaids.cpp' | |||
293 | --- src/jdbc.xq.src/javaids.cpp 2013-01-05 01:04:21 +0000 | |||
294 | +++ src/jdbc.xq.src/javaids.cpp 2013-02-02 04:42:22 +0000 | |||
295 | @@ -70,6 +70,7 @@ | |||
296 | 70 | getInt = env->GetMethodID(classID, "getInt", "(I)I"); | 70 | getInt = env->GetMethodID(classID, "getInt", "(I)I"); |
297 | 71 | getDouble = env->GetMethodID(classID, "getDouble", "(I)D"); | 71 | getDouble = env->GetMethodID(classID, "getDouble", "(I)D"); |
298 | 72 | getString = env->GetMethodID(classID, "getString", "(I)Ljava/lang/String;"); | 72 | getString = env->GetMethodID(classID, "getString", "(I)Ljava/lang/String;"); |
299 | 73 | getBLOB = env->GetMethodID(classID, "getBlob", "(I)Ljava/sql/Blob;"); | ||
300 | 73 | return true; | 74 | return true; |
301 | 74 | } | 75 | } |
302 | 75 | bool JavaResultSetMetadata::init() { | 76 | bool JavaResultSetMetadata::init() { |
303 | @@ -111,7 +112,12 @@ | |||
304 | 111 | getParameterType = env->GetMethodID(classID, "getParameterType", "(I)I"); | 112 | getParameterType = env->GetMethodID(classID, "getParameterType", "(I)I"); |
305 | 112 | return true; | 113 | return true; |
306 | 113 | } | 114 | } |
308 | 114 | 115 | bool JavaBlob::init() { | |
309 | 116 | classID = env->FindClass("java/sql/Blob"); | ||
310 | 117 | getBytes = env->GetMethodID(classID, "getBytes", "(JI)[B"); | ||
311 | 118 | length = env->GetMethodID(classID, "length", "()J"); | ||
312 | 119 | return true; | ||
313 | 120 | } | ||
314 | 115 | 121 | ||
315 | 116 | }}; // namespace zorba, jdbc | 122 | }}; // namespace zorba, jdbc |
316 | 117 | 123 | ||
317 | 118 | 124 | ||
318 | === modified file 'src/jdbc.xq.src/jdbc.cpp' | |||
319 | --- src/jdbc.xq.src/jdbc.cpp 2013-01-09 22:41:07 +0000 | |||
320 | +++ src/jdbc.xq.src/jdbc.cpp 2013-02-02 04:42:22 +0000 | |||
321 | @@ -69,6 +69,7 @@ | |||
322 | 69 | JavaResultSetMetadata jResultSetMetadata; | 69 | JavaResultSetMetadata jResultSetMetadata; |
323 | 70 | JavaPreparedStatement jPreparedStatement; | 70 | JavaPreparedStatement jPreparedStatement; |
324 | 71 | JavaParameterMetadata jParameterMetadata; | 71 | JavaParameterMetadata jParameterMetadata; |
325 | 72 | JavaBlob jBlob; | ||
326 | 72 | bool isOutputJSON = true; | 73 | bool isOutputJSON = true; |
327 | 73 | 74 | ||
328 | 74 | zorba::ExternalFunction* | 75 | zorba::ExternalFunction* |
329 | @@ -333,6 +334,7 @@ | |||
330 | 333 | jResultSetMetadata.init(); | 334 | jResultSetMetadata.init(); |
331 | 334 | jPreparedStatement.init(); | 335 | jPreparedStatement.init(); |
332 | 335 | jParameterMetadata.init(); | 336 | jParameterMetadata.init(); |
333 | 337 | jBlob.init(); | ||
334 | 336 | SQLTypes::init(); | 338 | SQLTypes::init(); |
335 | 337 | JDBC_MODULE_CATCH | 339 | JDBC_MODULE_CATCH |
336 | 338 | } | 340 | } |
337 | 339 | 341 | ||
338 | === modified file 'src/jdbc.xq.src/jsonitemsequence.cpp' | |||
339 | --- src/jdbc.xq.src/jsonitemsequence.cpp 2012-12-30 14:54:17 +0000 | |||
340 | +++ src/jdbc.xq.src/jsonitemsequence.cpp 2013-02-02 04:42:22 +0000 | |||
341 | @@ -78,7 +78,7 @@ | |||
342 | 78 | double value = env->CallDoubleMethod(oResultSet, jResultSet.getDouble, i+1); | 78 | double value = env->CallDoubleMethod(oResultSet, jResultSet.getDouble, i+1); |
343 | 79 | CHECK_EXCEPTION | 79 | CHECK_EXCEPTION |
344 | 80 | aValue = itemFactory->createDouble(value); | 80 | aValue = itemFactory->createDouble(value); |
346 | 81 | } else { | 81 | } else if (SQLTypes::isString(columnTypes[i])) { |
347 | 82 | jstring sValue = (jstring) env->CallObjectMethod(oResultSet, jResultSet.getString, i+1); | 82 | jstring sValue = (jstring) env->CallObjectMethod(oResultSet, jResultSet.getString, i+1); |
348 | 83 | CHECK_EXCEPTION | 83 | CHECK_EXCEPTION |
349 | 84 | if (sValue!=NULL) { | 84 | if (sValue!=NULL) { |
350 | @@ -89,6 +89,21 @@ | |||
351 | 89 | } else { | 89 | } else { |
352 | 90 | aValue = itemFactory->createJSONNull(); | 90 | aValue = itemFactory->createJSONNull(); |
353 | 91 | } | 91 | } |
354 | 92 | } else if (SQLTypes::isBLOB(columnTypes[i])) { | ||
355 | 93 | jobject oBlob = env->CallObjectMethod(oResultSet, jResultSet.getBLOB, i+1); | ||
356 | 94 | CHECK_EXCEPTION | ||
357 | 95 | if (oBlob!=NULL) { | ||
358 | 96 | jint length = env->CallIntMethod(oBlob, jBlob.length); | ||
359 | 97 | CHECK_EXCEPTION | ||
360 | 98 | jbyteArray bytes = (jbyteArray) env->CallObjectMethod(oBlob, jBlob.getBytes, 1, length); | ||
361 | 99 | CHECK_EXCEPTION | ||
362 | 100 | const char* byteString = (const char*)(env->GetByteArrayElements(bytes, 0)); | ||
363 | 101 | aValue = itemFactory->createBase64Binary(byteString, length); | ||
364 | 102 | } else { | ||
365 | 103 | aValue = itemFactory->createJSONNull(); | ||
366 | 104 | } | ||
367 | 105 | } else if (columnTypes[i]==SQLTypes::_NULL) { | ||
368 | 106 | aValue = itemFactory->createJSONNull(); | ||
369 | 92 | } | 107 | } |
370 | 93 | elements.push_back(std::pair<zorba::Item, zorba::Item>(aKey, aValue)); | 108 | elements.push_back(std::pair<zorba::Item, zorba::Item>(aKey, aValue)); |
371 | 94 | } | 109 | } |
372 | 95 | 110 | ||
373 | === modified file 'src/jdbc.xq.src/sqltypes.cpp' | |||
374 | --- src/jdbc.xq.src/sqltypes.cpp 2012-12-24 01:58:02 +0000 | |||
375 | +++ src/jdbc.xq.src/sqltypes.cpp 2013-02-02 04:42:22 +0000 | |||
376 | @@ -101,13 +101,28 @@ | |||
377 | 101 | VARCHAR = env->GetStaticIntField(cTypes, env->GetStaticFieldID(cTypes, "VARCHAR", "I")); | 101 | VARCHAR = env->GetStaticIntField(cTypes, env->GetStaticFieldID(cTypes, "VARCHAR", "I")); |
378 | 102 | } | 102 | } |
379 | 103 | 103 | ||
380 | 104 | bool SQLTypes::isBLOB(long lType) { | ||
381 | 105 | return ( | ||
382 | 106 | (lType == BINARY) || (lType == BLOB) || (lType==LONGVARBINARY) || (lType==VARBINARY) || | ||
383 | 107 | (lType == ARRAY) || (lType == DATALINK) || (lType==JAVA_OBJECT) || (lType==OTHER) || | ||
384 | 108 | (lType == REF) | ||
385 | 109 | ); | ||
386 | 110 | } | ||
387 | 111 | |||
388 | 112 | bool SQLTypes::isString(long lType) { | ||
389 | 113 | return ( | ||
390 | 114 | (lType == CHAR) || (lType == CLOB) || (lType == LONGVARCHAR) || (lType==LONGNVARCHAR) || | ||
391 | 115 | (lType==NCHAR) || (lType==NCLOB) || (lType==NVARCHAR) || (lType==VARCHAR) || | ||
392 | 116 | (lType==DATE) || (lType==TIME) || (lType==TIMESTAMP) || (lType==SQLXML) | ||
393 | 117 | ); | ||
394 | 118 | } | ||
395 | 119 | |||
396 | 104 | bool SQLTypes::isInt(long lType){ | 120 | bool SQLTypes::isInt(long lType){ |
398 | 105 | return ( (lType == INTEGER) || (lType==BIGINT) || (lType==TINYINT) || (lType==BIT) ); | 121 | return ( (lType == INTEGER) || (lType==BIGINT) || (lType==TINYINT) || (lType==SMALLINT) || (lType==BIT) ); |
399 | 106 | } | 122 | } |
400 | 107 | 123 | ||
401 | 108 | bool SQLTypes::isFloat(long lType){ | 124 | bool SQLTypes::isFloat(long lType){ |
402 | 109 | return ((lType == DECIMAL) || (lType==DOUBLE) || (lType==FLOAT) || (lType==NUMERIC) || (lType==REAL) ); | 125 | return ((lType == DECIMAL) || (lType==DOUBLE) || (lType==FLOAT) || (lType==NUMERIC) || (lType==REAL) ); |
403 | 110 | } | 126 | } |
404 | 111 | 127 | ||
405 | 112 | |||
406 | 113 | }}; // namespace zorba, jdbc | 128 | }}; // namespace zorba, jdbc |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ bug1109853- 2013-01- 30T03-42- 05.903Z/ log.html
Log at: http://