1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>PreparedStatement.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<style type="text/css" media="screen">
body {background-color:white;}
body,div,p,dl,.memname, .params, .exception {font: normal normal normal 16px/22px "HelveticaNeue", Helvetica, "Arial Narrow", Arial, sans-serif;}
#nav-path {display:none;}
h2:first-of-type {margin-top:2px; border:none;}
h2.groupheader {font-size:26px; line-height:28px;color:#286796;}
div.groupheader { font-weight:600; font-size:18px;color: rgb(51, 51, 51);}
h3 {font-size:20px;color: rgb(51, 51, 51);}
div.header { background-image:none; background-color: #3b96d7; color:white;}
div.title {text-align:center;font-size: 28px; font-weight:100;}
.summary {display:none;}
dl.section {border:none;}
.memproto > *, .memitem > * {
box-shadow: none!important;
-moz-box-shadow: none!important;
-webkit-box-shadow: none!important;
background-image:none!important;
}
.memproto {
border-bottom: 1px #b8c8e9 solid;
background-color: #f7fcff;
}
pre {white-space: pre-wrap;}
.textinfo {color: #428bca;}
.textnote {color: #a94442;}
</style>
</head><body>
<!-- Generated by Doxygen 1.8.5 -->
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_bb61871b4c63e4e6685a8d6c52430594.html">zdb</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">PreparedStatement.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <b>PreparedStatement</b> represent a single SQL statement pre-compiled into byte code for later execution. </p>
<p>The SQL statement may contain <em>in</em> parameters of the form "?". Such parameters represent unspecified literal values (or "wildcards") to be filled in later by the various setter methods defined in this interface. Each <em>in</em> parameter has an associated index number which is its sequence in the statement. The first <em>in</em> '?' parameter has index 1, the next has index 2 and so on. A PreparedStatement is created by calling <a class="el" href="Connection_8h.html#a16dfbbe273d9a872462bed182dec3bb5" title="Creates a PreparedStatement object for sending parameterized SQL statements to the database...">Connection_prepareStatement()</a>.</p>
<p>Consider this statement: </p>
<pre>
INSERT INTO employee(name, picture) VALUES(?, ?)
</pre><p> There are two <em>in</em> parameters in this statement, the parameter for setting the name has index 1 and the one for the picture has index 2. To set the values for the <em>in</em> parameters we use a setter method. Assuming name has a string value we use <a class="el" href="PreparedStatement_8h.html#a618654d179459a9394828a4117f97d05" title="Sets the in parameter at index parameterIndex to the given string value. ">PreparedStatement_setString()</a>. To set the value of the picture we submit a binary value using the method <a class="el" href="PreparedStatement_8h.html#ac19d3cb5e6ee2222c1320f9aee7547ff" title="Sets the in parameter at index parameterIndex to the given blob value. ">PreparedStatement_setBlob()</a>.</p>
<p>Note that string and blob parameter values are set by reference and <b>must</b> not "disappear" before either <a class="el" href="PreparedStatement_8h.html#a6f0eb01daec7f61bf92707b7de0a246f" title="Executes the prepared SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL st...">PreparedStatement_execute()</a> or <a class="el" href="PreparedStatement_8h.html#a3e33ed8289ac8b8b11438b009a169e63" title="Executes the prepared SQL statement, which returns a single ResultSet object. ">PreparedStatement_executeQuery()</a> is called.</p>
<h3>Example:</h3>
<p>To summarize, here is the code in context. </p>
<pre>
PreparedStatement_T p = Connection_prepareStatement(con, "INSERT INTO employee(name, picture) VALUES(?, ?)");
PreparedStatement_setString(p, 1, "Kamiya Kaoru");
PreparedStatement_setBlob(p, 2, jpeg, jpeg_size);
PreparedStatement_execute(p);
</pre> <h3>Reuse:</h3>
<p>A PreparedStatement can be reused. That is, the method <a class="el" href="PreparedStatement_8h.html#a6f0eb01daec7f61bf92707b7de0a246f" title="Executes the prepared SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL st...">PreparedStatement_execute()</a> can be called one or more times to execute the same statement. Clients can also set new <em>in</em> parameter values and re-execute the statement as shown in this example: </p>
<pre>
PreparedStatement_T p = Connection_prepareStatement(con, "INSERT INTO employee(name, picture) VALUES(?, ?)");
for (int i = 0; employees[i].name; i++)
{
PreparedStatement_setString(p, 1, employees[i].name);
PreparedStatement_setBlob(p, 2, employees[i].picture, employees[i].picture_size);
PreparedStatement_execute(p);
}
</pre> <h3>Result Sets:</h3>
<p>Here is another example where we use a Prepared Statement to execute a query which returns a Result Set:</p>
<pre>
PreparedStatement_T p = Connection_prepareStatement(con, "SELECT id FROM employee WHERE name LIKE ?");
PreparedStatement_setString(p, 1, "%Kaoru%");
ResultSet_T r = PreparedStatement_executeQuery(p);
while (ResultSet_next(r))
printf("employee.id = %d\n", ResultSet_getInt(r, 1));
</pre><p>A ResultSet returned from <a class="el" href="PreparedStatement_8h.html#a3e33ed8289ac8b8b11438b009a169e63" title="Executes the prepared SQL statement, which returns a single ResultSet object. ">PreparedStatement_executeQuery()</a> "lives" until the Prepared Statement is executed again or until the Connection is returned to the Connection Pool.</p>
<h3>Date and Time</h3>
<p>PreparedStatement provides <a class="el" href="PreparedStatement_8h.html#a3cf4d848d41a7901727bccac2b58d31c" title="Sets the in parameter at index parameterIndex to the given Unix timestamp value. ">PreparedStatement_setTimestamp()</a> for setting a Unix timestamp value. To set SQL Date, Time or DateTime values, simply use <a class="el" href="PreparedStatement_8h.html#a618654d179459a9394828a4117f97d05" title="Sets the in parameter at index parameterIndex to the given string value. ">PreparedStatement_setString()</a> with a time string format understood by your database. For instance to set a SQL Date value, </p>
<pre>
PreparedStatement_setString(p, parameterIndex, "2013-12-28");
</pre><p><em>A PreparedStatement is reentrant, but not thread-safe and should only be used by one thread (at the time).</em></p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system. ">Connection.h</a> <a class="el" href="ResultSet_8h.html" title="A ResultSet represents a database result set. ">ResultSet.h</a> <a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a0acb682b8260ab1c60b918599864e2e5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a0acb682b8260ab1c60b918599864e2e5">T</a>   PreparedStatement_T</td></tr>
<tr class="separator:a0acb682b8260ab1c60b918599864e2e5"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a9e5cf7eed5e2233d2e8e90a70d1e0f77"><td class="memItemLeft" align="right" valign="top">typedef struct <br class="typebreak"/>
PreparedStatement_S * </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a9e5cf7eed5e2233d2e8e90a70d1e0f77">T</a></td></tr>
<tr class="separator:a9e5cf7eed5e2233d2e8e90a70d1e0f77"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a6f0eb01daec7f61bf92707b7de0a246f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a6f0eb01daec7f61bf92707b7de0a246f">PreparedStatement_execute</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P)</td></tr>
<tr class="memdesc:a6f0eb01daec7f61bf92707b7de0a246f"><td class="mdescLeft"> </td><td class="mdescRight">Executes the prepared SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement. <a href="#a6f0eb01daec7f61bf92707b7de0a246f">More...</a><br/></td></tr>
<tr class="separator:a6f0eb01daec7f61bf92707b7de0a246f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3e33ed8289ac8b8b11438b009a169e63"><td class="memItemLeft" align="right" valign="top">ResultSet_T </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a3e33ed8289ac8b8b11438b009a169e63">PreparedStatement_executeQuery</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P)</td></tr>
<tr class="memdesc:a3e33ed8289ac8b8b11438b009a169e63"><td class="mdescLeft"> </td><td class="mdescRight">Executes the prepared SQL statement, which returns a single ResultSet object. <a href="#a3e33ed8289ac8b8b11438b009a169e63">More...</a><br/></td></tr>
<tr class="separator:a3e33ed8289ac8b8b11438b009a169e63"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaaaec0e14c95b70b342dff0cf604cadd"><td class="memItemLeft" align="right" valign="top">long long </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#aaaaec0e14c95b70b342dff0cf604cadd">PreparedStatement_rowsChanged</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P)</td></tr>
<tr class="memdesc:aaaaec0e14c95b70b342dff0cf604cadd"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of rows that was inserted, deleted or modified by the most recently completed SQL statement on the database connection. <a href="#aaaaec0e14c95b70b342dff0cf604cadd">More...</a><br/></td></tr>
<tr class="separator:aaaaec0e14c95b70b342dff0cf604cadd"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Parameters</div></td></tr>
<tr class="memitem:a618654d179459a9394828a4117f97d05"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a618654d179459a9394828a4117f97d05">PreparedStatement_setString</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P, int parameterIndex, const char *x)</td></tr>
<tr class="memdesc:a618654d179459a9394828a4117f97d05"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given string value. <a href="#a618654d179459a9394828a4117f97d05">More...</a><br/></td></tr>
<tr class="separator:a618654d179459a9394828a4117f97d05"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a350056fea6744da297b674bfbe1ee94e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a350056fea6744da297b674bfbe1ee94e">PreparedStatement_setInt</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P, int parameterIndex, int x)</td></tr>
<tr class="memdesc:a350056fea6744da297b674bfbe1ee94e"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given int value. <a href="#a350056fea6744da297b674bfbe1ee94e">More...</a><br/></td></tr>
<tr class="separator:a350056fea6744da297b674bfbe1ee94e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac8e3eafb030f466356edc9bdffae841a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#ac8e3eafb030f466356edc9bdffae841a">PreparedStatement_setLLong</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P, int parameterIndex, long long x)</td></tr>
<tr class="memdesc:ac8e3eafb030f466356edc9bdffae841a"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given long long value. <a href="#ac8e3eafb030f466356edc9bdffae841a">More...</a><br/></td></tr>
<tr class="separator:ac8e3eafb030f466356edc9bdffae841a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a023adeb93e4ff455d57a9a5be8d1e26f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a023adeb93e4ff455d57a9a5be8d1e26f">PreparedStatement_setDouble</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P, int parameterIndex, double x)</td></tr>
<tr class="memdesc:a023adeb93e4ff455d57a9a5be8d1e26f"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given double value. <a href="#a023adeb93e4ff455d57a9a5be8d1e26f">More...</a><br/></td></tr>
<tr class="separator:a023adeb93e4ff455d57a9a5be8d1e26f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac19d3cb5e6ee2222c1320f9aee7547ff"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#ac19d3cb5e6ee2222c1320f9aee7547ff">PreparedStatement_setBlob</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P, int parameterIndex, const void *x, int size)</td></tr>
<tr class="memdesc:ac19d3cb5e6ee2222c1320f9aee7547ff"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given blob value. <a href="#ac19d3cb5e6ee2222c1320f9aee7547ff">More...</a><br/></td></tr>
<tr class="separator:ac19d3cb5e6ee2222c1320f9aee7547ff"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3cf4d848d41a7901727bccac2b58d31c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#a3cf4d848d41a7901727bccac2b58d31c">PreparedStatement_setTimestamp</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P, int parameterIndex, time_t x)</td></tr>
<tr class="memdesc:a3cf4d848d41a7901727bccac2b58d31c"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given Unix timestamp value. <a href="#a3cf4d848d41a7901727bccac2b58d31c">More...</a><br/></td></tr>
<tr class="separator:a3cf4d848d41a7901727bccac2b58d31c"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Properties</div></td></tr>
<tr class="memitem:ace45c650c6146570da0067a7329edc09"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="PreparedStatement_8h.html#ace45c650c6146570da0067a7329edc09">PreparedStatement_getParameterCount</a> (<a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> P)</td></tr>
<tr class="memdesc:ace45c650c6146570da0067a7329edc09"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of parameters in this prepared statement. <a href="#ace45c650c6146570da0067a7329edc09">More...</a><br/></td></tr>
<tr class="separator:ace45c650c6146570da0067a7329edc09"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a0acb682b8260ab1c60b918599864e2e5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a>   PreparedStatement_T</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a9e5cf7eed5e2233d2e8e90a70d1e0f77"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct PreparedStatement_S* <a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a618654d179459a9394828a4117f97d05"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PreparedStatement_setString </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>parameterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>x</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given string value. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
<tr><td class="paramname">parameterIndex</td><td>The first parameter is 1, the second is 2,.. </td></tr>
<tr><td class="paramname">x</td><td>The string value to set. Must be a NUL terminated string. NULL is allowed to indicate a SQL NULL value. </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database access error occurs or if parameter index is out of range </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a350056fea6744da297b674bfbe1ee94e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PreparedStatement_setInt </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>parameterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>x</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given int value. </p>
<p>In general, on both 32 and 64 bits architecture, <code>int</code> is 4 bytes or 32 bits and <code>long long</code> is 8 bytes or 64 bits. A <code>long</code> type is usually equal to <code>int</code> on 32 bits architecture and equal to <code>long long</code> on 64 bits architecture. However, the width of integer types are architecture and compiler dependent. The above is usually true, but not necessarily. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
<tr><td class="paramname">parameterIndex</td><td>The first parameter is 1, the second is 2,.. </td></tr>
<tr><td class="paramname">x</td><td>The int value to set </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database access error occurs or if parameter index is out of range </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ac8e3eafb030f466356edc9bdffae841a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PreparedStatement_setLLong </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>parameterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long long </td>
<td class="paramname"><em>x</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given long long value. </p>
<p>In general, on both 32 and 64 bits architecture, <code>int</code> is 4 bytes or 32 bits and <code>long long</code> is 8 bytes or 64 bits. A <code>long</code> type is usually equal to <code>int</code> on 32 bits architecture and equal to <code>long long</code> on 64 bits architecture. However, the width of integer types are architecture and compiler dependent. The above is usually true, but not necessarily. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
<tr><td class="paramname">parameterIndex</td><td>The first parameter is 1, the second is 2,.. </td></tr>
<tr><td class="paramname">x</td><td>The long long value to set </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database access error occurs or if parameter index is out of range </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a023adeb93e4ff455d57a9a5be8d1e26f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PreparedStatement_setDouble </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>parameterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"><em>x</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given double value. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
<tr><td class="paramname">parameterIndex</td><td>The first parameter is 1, the second is 2,.. </td></tr>
<tr><td class="paramname">x</td><td>The double value to set </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database access error occurs or if parameter index is out of range </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ac19d3cb5e6ee2222c1320f9aee7547ff"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PreparedStatement_setBlob </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>parameterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given blob value. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
<tr><td class="paramname">parameterIndex</td><td>The first parameter is 1, the second is 2,.. </td></tr>
<tr><td class="paramname">x</td><td>The blob value to set </td></tr>
<tr><td class="paramname">size</td><td>The number of bytes in the blob </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database access error occurs or if parameter index is out of range </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a3cf4d848d41a7901727bccac2b58d31c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PreparedStatement_setTimestamp </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>parameterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">time_t </td>
<td class="paramname"><em>x</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the <em>in</em> parameter at index <code>parameterIndex</code> to the given Unix timestamp value. </p>
<p>The timestamp value given in <code>x</code> is expected to be in the GMT timezone. For instance, a value returned by time(3) which represents the system's notion of the current Greenwich time. <em class="textinfo">SQLite</em> does not have temporal SQL data types per se and using this method with SQLite will store the timestamp value as a numerical type as-is. This is usually what you want anyway, since it is fast, compact and unambiguous. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
<tr><td class="paramname">parameterIndex</td><td>The first parameter is 1, the second is 2,.. </td></tr>
<tr><td class="paramname">x</td><td>The GMT timestamp value to set. E.g. a value returned by time(3) </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database access error occurs or if parameter index is out of range </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> <a class="el" href="ResultSet_8h.html#a073df52b04dfbaaaf088baede0f770f5" title="Retrieves the value of the designated column in the current row of this ResultSet object as a Unix ti...">ResultSet_getTimestamp</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a6f0eb01daec7f61bf92707b7de0a246f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PreparedStatement_execute </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Executes the prepared SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database error occurs </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a3e33ed8289ac8b8b11438b009a169e63"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ResultSet_T PreparedStatement_executeQuery </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Executes the prepared SQL statement, which returns a single ResultSet object. </p>
<p>A ResultSet "lives" only until the next call to a PreparedStatement method or until the Connection is returned to the Connection Pool. <em>This means that Result Sets cannot be saved between queries</em>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A ResultSet object that contains the data produced by the prepared statement. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">SQLException</td><td>If a database error occurs </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="ResultSet_8h.html" title="A ResultSet represents a database result set. ">ResultSet.h</a> </dd>
<dd>
<a class="el" href="SQLException_8h.html" title="Signals that an SQL specific exception has occurred. ">SQLException.h</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aaaaec0e14c95b70b342dff0cf604cadd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long long PreparedStatement_rowsChanged </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of rows that was inserted, deleted or modified by the most recently completed SQL statement on the database connection. </p>
<p>If used with a transaction, this method should be called <em>before</em> commit is executed, otherwise 0 is returned. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of rows changed by the last (DIM) SQL statement </dd></dl>
</div>
</div>
<a class="anchor" id="ace45c650c6146570da0067a7329edc09"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int PreparedStatement_getParameterCount </td>
<td>(</td>
<td class="paramtype"><a class="el" href="Connection_8h.html#a8dc1b239f8e305fbd1406ff041c89151">T</a> </td>
<td class="paramname"><em>P</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of parameters in this prepared statement. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">P</td><td>A PreparedStatement object </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of parameters in this prepared statement </dd></dl>
</div>
</div>
</div><!-- contents -->
<p style="text-align:center;color:#808080;font-size:90%;margin:40px 0 20px 0;">
Copyright © <a href="http://tildeslash.com/">Tildeslash Ltd</a>. All
rights reserved.</p>
</body></html>
|