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 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MySQL++ Reference Manual</title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MySQL++: mysqlpp::Connection Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">MySQL++
 <span id="projectnumber">3.2.5</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>mysqlpp</b></li><li class="navelem"><a class="el" href="classmysqlpp_1_1Connection.html">Connection</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="#pro-methods">Protected Member Functions</a> |
<a href="#pro-attribs">Protected Attributes</a> |
<a href="classmysqlpp_1_1Connection-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mysqlpp::Connection Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Manages the connection to the database server.
<a href="classmysqlpp_1_1Connection.html#details">More...</a></p>
<p><code>#include <<a class="el" href="connection_8h_source.html">connection.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for mysqlpp::Connection:</div>
<div class="dyncontent">
<div class="center"><img src="classmysqlpp_1_1Connection__inherit__graph.png" border="0" usemap="#mysqlpp_1_1Connection_inherit__map" alt="Inheritance graph"/></div>
<map name="mysqlpp_1_1Connection_inherit__map" id="mysqlpp_1_1Connection_inherit__map">
<area shape="rect" title="Manages the connection to the database server." alt="" coords="247,61,392,87"/>
<area shape="rect" href="classmysqlpp_1_1TCPConnection.html" title="Specialization of Connection for TCP/IP." alt="" coords="455,5,628,31"/>
<area shape="rect" href="classmysqlpp_1_1UnixDomainSocketConnection.html" title="Specialization of Connection for Unix domain sockets." alt="" coords="446,55,637,93"/>
<area shape="rect" href="classmysqlpp_1_1WindowsNamedPipeConnection.html" title="Specialization of Connection for Windows named pipes." alt="" coords="440,117,643,156"/>
<area shape="rect" href="classmysqlpp_1_1OptionalExceptions.html" title="Interface allowing a class to have optional exceptions." alt="" coords="5,61,199,87"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for mysqlpp::Connection:</div>
<div class="dyncontent">
<div class="center"><img src="classmysqlpp_1_1Connection__coll__graph.png" border="0" usemap="#mysqlpp_1_1Connection_coll__map" alt="Collaboration graph"/></div>
<map name="mysqlpp_1_1Connection_coll__map" id="mysqlpp_1_1Connection_coll__map">
<area shape="rect" title="Manages the connection to the database server." alt="" coords="102,92,248,117"/>
<area shape="rect" href="classmysqlpp_1_1OptionalExceptions.html" title="Interface allowing a class to have optional exceptions." alt="" coords="5,5,199,31"/>
<area shape="rect" title=" " alt="" coords="223,5,277,31"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0053ef79210079a5579e55a12fe5f10a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a0053ef79210079a5579e55a12fe5f10a">Connection</a> (bool te=true)</td></tr>
<tr class="memdesc:a0053ef79210079a5579e55a12fe5f10a"><td class="mdescLeft"> </td><td class="mdescRight">Create object without connecting to the database server. <a href="#a0053ef79210079a5579e55a12fe5f10a">More...</a><br /></td></tr>
<tr class="separator:a0053ef79210079a5579e55a12fe5f10a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a382ec4947dbb1998833ad0fc6f93d1c9"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a382ec4947dbb1998833ad0fc6f93d1c9">Connection</a> (const char *db, const char *server=0, const char *user=0, const char *password=0, unsigned int port=0)</td></tr>
<tr class="memdesc:a382ec4947dbb1998833ad0fc6f93d1c9"><td class="mdescLeft"> </td><td class="mdescRight">Create object and connect to database server in one step. <a href="#a382ec4947dbb1998833ad0fc6f93d1c9">More...</a><br /></td></tr>
<tr class="separator:a382ec4947dbb1998833ad0fc6f93d1c9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a23e80d1b3fee58e8771b2a6dd3c9ac3f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a23e80d1b3fee58e8771b2a6dd3c9ac3f">Connection</a> (const <a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> &other)</td></tr>
<tr class="memdesc:a23e80d1b3fee58e8771b2a6dd3c9ac3f"><td class="mdescLeft"> </td><td class="mdescRight">Establish a new connection using the same parameters as an existing connection. <a href="#a23e80d1b3fee58e8771b2a6dd3c9ac3f">More...</a><br /></td></tr>
<tr class="separator:a23e80d1b3fee58e8771b2a6dd3c9ac3f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8eda1910b116f1ccdc1a86711ca6f660"><td class="memItemLeft" align="right" valign="top"><a id="a8eda1910b116f1ccdc1a86711ca6f660"></a>
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a8eda1910b116f1ccdc1a86711ca6f660">~Connection</a> ()</td></tr>
<tr class="memdesc:a8eda1910b116f1ccdc1a86711ca6f660"><td class="mdescLeft"> </td><td class="mdescRight">Destroy object. <br /></td></tr>
<tr class="separator:a8eda1910b116f1ccdc1a86711ca6f660"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8923972d5b75e0cd194b556ca3c11dd9"><td class="memItemLeft" align="right" valign="top"><a id="a8923972d5b75e0cd194b556ca3c11dd9"></a>
std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a8923972d5b75e0cd194b556ca3c11dd9">client_version</a> () const</td></tr>
<tr class="memdesc:a8923972d5b75e0cd194b556ca3c11dd9"><td class="mdescLeft"> </td><td class="mdescRight">Get version of library underpinning the current database driver. <br /></td></tr>
<tr class="separator:a8923972d5b75e0cd194b556ca3c11dd9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa8e2b54058f7ff7c480e34129a8ee212"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#aa8e2b54058f7ff7c480e34129a8ee212">connect</a> (const char *db=0, const char *server=0, const char *user=0, const char *password=0, unsigned int port=0)</td></tr>
<tr class="memdesc:aa8e2b54058f7ff7c480e34129a8ee212"><td class="mdescLeft"> </td><td class="mdescRight">Connect to database after object is created. <a href="#aa8e2b54058f7ff7c480e34129a8ee212">More...</a><br /></td></tr>
<tr class="separator:aa8e2b54058f7ff7c480e34129a8ee212"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac9e310f5c544a7aec143c02f4618ff69"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#ac9e310f5c544a7aec143c02f4618ff69">connected</a> () const</td></tr>
<tr class="memdesc:ac9e310f5c544a7aec143c02f4618ff69"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if connection was established successfully. <a href="#ac9e310f5c544a7aec143c02f4618ff69">More...</a><br /></td></tr>
<tr class="separator:ac9e310f5c544a7aec143c02f4618ff69"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a71356d1ca53c988bf9f1e1946e4a7f48"><td class="memItemLeft" align="right" valign="top">ulonglong </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a71356d1ca53c988bf9f1e1946e4a7f48">count_rows</a> (const std::string &table)</td></tr>
<tr class="memdesc:a71356d1ca53c988bf9f1e1946e4a7f48"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of rows in a table. <a href="#a71356d1ca53c988bf9f1e1946e4a7f48">More...</a><br /></td></tr>
<tr class="separator:a71356d1ca53c988bf9f1e1946e4a7f48"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac9852fb87572c6f10c6de051bacf6b8d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#ac9852fb87572c6f10c6de051bacf6b8d">create_db</a> (const std::string &db)</td></tr>
<tr class="memdesc:ac9852fb87572c6f10c6de051bacf6b8d"><td class="mdescLeft"> </td><td class="mdescRight">Ask the database server to create a database. <a href="#ac9852fb87572c6f10c6de051bacf6b8d">More...</a><br /></td></tr>
<tr class="separator:ac9852fb87572c6f10c6de051bacf6b8d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a61e571ee724d79c455555f62472880ef"><td class="memItemLeft" align="right" valign="top"><a id="a61e571ee724d79c455555f62472880ef"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a61e571ee724d79c455555f62472880ef">disconnect</a> ()</td></tr>
<tr class="memdesc:a61e571ee724d79c455555f62472880ef"><td class="mdescLeft"> </td><td class="mdescRight">Drop the connection to the database server. <br /></td></tr>
<tr class="separator:a61e571ee724d79c455555f62472880ef"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0d118df40a7bd4bb63e7286b221f7680"><td class="memItemLeft" align="right" valign="top"><a id="a0d118df40a7bd4bb63e7286b221f7680"></a>
<a class="el" href="classmysqlpp_1_1DBDriver.html">DBDriver</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a0d118df40a7bd4bb63e7286b221f7680">driver</a> ()</td></tr>
<tr class="memdesc:a0d118df40a7bd4bb63e7286b221f7680"><td class="mdescLeft"> </td><td class="mdescRight">Returns a reference to the current database driver. <br /></td></tr>
<tr class="separator:a0d118df40a7bd4bb63e7286b221f7680"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa073e784a16a9d4b357740a626a6b2e1"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#aa073e784a16a9d4b357740a626a6b2e1">drop_db</a> (const std::string &db)</td></tr>
<tr class="memdesc:aa073e784a16a9d4b357740a626a6b2e1"><td class="mdescLeft"> </td><td class="mdescRight">Asks the database server to drop (destroy) a database. <a href="#aa073e784a16a9d4b357740a626a6b2e1">More...</a><br /></td></tr>
<tr class="separator:aa073e784a16a9d4b357740a626a6b2e1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3cb1bf601b19dbb87b36bed4590f4214"><td class="memItemLeft" align="right" valign="top"><a id="a3cb1bf601b19dbb87b36bed4590f4214"></a>
int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a3cb1bf601b19dbb87b36bed4590f4214">errnum</a> ()</td></tr>
<tr class="memdesc:a3cb1bf601b19dbb87b36bed4590f4214"><td class="mdescLeft"> </td><td class="mdescRight">Return last error number associated with this connection. <br /></td></tr>
<tr class="separator:a3cb1bf601b19dbb87b36bed4590f4214"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abe12a159a0a05fbd6c9ade18cea39246"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#abe12a159a0a05fbd6c9ade18cea39246">error</a> () const</td></tr>
<tr class="memdesc:abe12a159a0a05fbd6c9ade18cea39246"><td class="mdescLeft"> </td><td class="mdescRight">Return error message for last error associated with this connection. <a href="#abe12a159a0a05fbd6c9ade18cea39246">More...</a><br /></td></tr>
<tr class="separator:abe12a159a0a05fbd6c9ade18cea39246"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acdd753570fdc8239f0aa1f3160673272"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#acdd753570fdc8239f0aa1f3160673272">ipc_info</a> () const</td></tr>
<tr class="memdesc:acdd753570fdc8239f0aa1f3160673272"><td class="mdescLeft"> </td><td class="mdescRight">Get information about the IPC connection to the database server. <a href="#acdd753570fdc8239f0aa1f3160673272">More...</a><br /></td></tr>
<tr class="separator:acdd753570fdc8239f0aa1f3160673272"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8d934ece7ac0fdc7341022f7af75225f"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a8d934ece7ac0fdc7341022f7af75225f">kill</a> (unsigned long tid) const</td></tr>
<tr class="memdesc:a8d934ece7ac0fdc7341022f7af75225f"><td class="mdescLeft"> </td><td class="mdescRight">Kill a database server thread. <a href="#a8d934ece7ac0fdc7341022f7af75225f">More...</a><br /></td></tr>
<tr class="separator:a8d934ece7ac0fdc7341022f7af75225f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac566c5ccf8cf92d3b80969bd09bea184"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#ac566c5ccf8cf92d3b80969bd09bea184">operator private_bool_type</a> () const</td></tr>
<tr class="memdesc:ac566c5ccf8cf92d3b80969bd09bea184"><td class="mdescLeft"> </td><td class="mdescRight">Test whether any error has occurred within the object. <a href="#ac566c5ccf8cf92d3b80969bd09bea184">More...</a><br /></td></tr>
<tr class="separator:ac566c5ccf8cf92d3b80969bd09bea184"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaf58375723c00a4ac494c83ab384596e"><td class="memItemLeft" align="right" valign="top"><a id="aaf58375723c00a4ac494c83ab384596e"></a>
<a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#aaf58375723c00a4ac494c83ab384596e">operator=</a> (const <a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> &rhs)</td></tr>
<tr class="memdesc:aaf58375723c00a4ac494c83ab384596e"><td class="mdescLeft"> </td><td class="mdescRight">Copy an existing <a class="el" href="classmysqlpp_1_1Connection.html" title="Manages the connection to the database server.">Connection</a> object's state into this object. <br /></td></tr>
<tr class="separator:aaf58375723c00a4ac494c83ab384596e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac1dbc411f7ab1debbabe241561fe4091"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#ac1dbc411f7ab1debbabe241561fe4091">ping</a> ()</td></tr>
<tr class="memdesc:ac1dbc411f7ab1debbabe241561fe4091"><td class="mdescLeft"> </td><td class="mdescRight">"Pings" the database server <a href="#ac1dbc411f7ab1debbabe241561fe4091">More...</a><br /></td></tr>
<tr class="separator:ac1dbc411f7ab1debbabe241561fe4091"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4f5e8249ddaeeaeb94e01ae71f4181f0"><td class="memItemLeft" align="right" valign="top"><a id="a4f5e8249ddaeeaeb94e01ae71f4181f0"></a>
int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a4f5e8249ddaeeaeb94e01ae71f4181f0">protocol_version</a> () const</td></tr>
<tr class="memdesc:a4f5e8249ddaeeaeb94e01ae71f4181f0"><td class="mdescLeft"> </td><td class="mdescRight">Returns version number of the protocol the database driver uses to communicate with the server. <br /></td></tr>
<tr class="separator:a4f5e8249ddaeeaeb94e01ae71f4181f0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6954d437d52004915fbc96a0be79ab37"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmysqlpp_1_1Query.html">Query</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a6954d437d52004915fbc96a0be79ab37">query</a> (const char *qstr=0)</td></tr>
<tr class="memdesc:a6954d437d52004915fbc96a0be79ab37"><td class="mdescLeft"> </td><td class="mdescRight">Return a new query object. <a href="#a6954d437d52004915fbc96a0be79ab37">More...</a><br /></td></tr>
<tr class="separator:a6954d437d52004915fbc96a0be79ab37"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af7aaad10bb2f08cae4384f5c227c0f19"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmysqlpp_1_1Query.html">Query</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#af7aaad10bb2f08cae4384f5c227c0f19">query</a> (const std::string &qstr)</td></tr>
<tr class="memdesc:af7aaad10bb2f08cae4384f5c227c0f19"><td class="mdescLeft"> </td><td class="mdescRight">Return a new query object. <a href="#af7aaad10bb2f08cae4384f5c227c0f19">More...</a><br /></td></tr>
<tr class="separator:af7aaad10bb2f08cae4384f5c227c0f19"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af1bd6c380dea4cf157e4de7295550a0c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#af1bd6c380dea4cf157e4de7295550a0c">select_db</a> (const std::string &db)</td></tr>
<tr class="memdesc:af1bd6c380dea4cf157e4de7295550a0c"><td class="mdescLeft"> </td><td class="mdescRight">Change to a different database managed by the database server we are connected to. <a href="#af1bd6c380dea4cf157e4de7295550a0c">More...</a><br /></td></tr>
<tr class="separator:af1bd6c380dea4cf157e4de7295550a0c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac437af32250e56136373c3d9e38413d6"><td class="memItemLeft" align="right" valign="top"><a id="ac437af32250e56136373c3d9e38413d6"></a>
std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#ac437af32250e56136373c3d9e38413d6">server_version</a> () const</td></tr>
<tr class="memdesc:ac437af32250e56136373c3d9e38413d6"><td class="mdescLeft"> </td><td class="mdescRight">Get the database server's version string. <br /></td></tr>
<tr class="separator:ac437af32250e56136373c3d9e38413d6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a266f69b0e8d9d588e8cc6c5a2a897b87"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a266f69b0e8d9d588e8cc6c5a2a897b87">set_option</a> (<a class="el" href="classmysqlpp_1_1Option.html">Option</a> *o)</td></tr>
<tr class="memdesc:a266f69b0e8d9d588e8cc6c5a2a897b87"><td class="mdescLeft"> </td><td class="mdescRight">Sets a connection option. <a href="#a266f69b0e8d9d588e8cc6c5a2a897b87">More...</a><br /></td></tr>
<tr class="separator:a266f69b0e8d9d588e8cc6c5a2a897b87"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8fed0ebc10f72fe591941dc6f64b6f20"><td class="memItemLeft" align="right" valign="top"><a id="a8fed0ebc10f72fe591941dc6f64b6f20"></a>
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a8fed0ebc10f72fe591941dc6f64b6f20">shutdown</a> ()</td></tr>
<tr class="memdesc:a8fed0ebc10f72fe591941dc6f64b6f20"><td class="mdescLeft"> </td><td class="mdescRight">Ask database server to shut down. <br /></td></tr>
<tr class="separator:a8fed0ebc10f72fe591941dc6f64b6f20"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a63c741b003f7bd9d51434a25290e65c0"><td class="memItemLeft" align="right" valign="top"><a id="a63c741b003f7bd9d51434a25290e65c0"></a>
std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a63c741b003f7bd9d51434a25290e65c0">server_status</a> () const</td></tr>
<tr class="memdesc:a63c741b003f7bd9d51434a25290e65c0"><td class="mdescLeft"> </td><td class="mdescRight">Returns information about database server's status. <br /></td></tr>
<tr class="separator:a63c741b003f7bd9d51434a25290e65c0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a60c43e10eb9db82c075443add56785ce"><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a60c43e10eb9db82c075443add56785ce">thread_id</a> ()</td></tr>
<tr class="memdesc:a60c43e10eb9db82c075443add56785ce"><td class="mdescLeft"> </td><td class="mdescRight">Returns the database server's thread ID for this connection. <a href="#a60c43e10eb9db82c075443add56785ce">More...</a><br /></td></tr>
<tr class="separator:a60c43e10eb9db82c075443add56785ce"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classmysqlpp_1_1OptionalExceptions"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classmysqlpp_1_1OptionalExceptions')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classmysqlpp_1_1OptionalExceptions.html">mysqlpp::OptionalExceptions</a></td></tr>
<tr class="memitem:a45a3e93f56716abf10704419b5ba4f31 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1OptionalExceptions.html#a45a3e93f56716abf10704419b5ba4f31">OptionalExceptions</a> (bool e=true)</td></tr>
<tr class="memdesc:a45a3e93f56716abf10704419b5ba4f31 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="classmysqlpp_1_1OptionalExceptions.html#a45a3e93f56716abf10704419b5ba4f31">More...</a><br /></td></tr>
<tr class="separator:a45a3e93f56716abf10704419b5ba4f31 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae97334b7e5f89c1927c5d277b770db0a inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memItemLeft" align="right" valign="top"><a id="ae97334b7e5f89c1927c5d277b770db0a"></a>
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1OptionalExceptions.html#ae97334b7e5f89c1927c5d277b770db0a">~OptionalExceptions</a> ()</td></tr>
<tr class="memdesc:ae97334b7e5f89c1927c5d277b770db0a inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="mdescLeft"> </td><td class="mdescRight">Destroy object. <br /></td></tr>
<tr class="separator:ae97334b7e5f89c1927c5d277b770db0a inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a46ce5ac667513bac88c0bd459115f236 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memItemLeft" align="right" valign="top"><a id="a46ce5ac667513bac88c0bd459115f236"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1OptionalExceptions.html#a46ce5ac667513bac88c0bd459115f236">enable_exceptions</a> () const</td></tr>
<tr class="memdesc:a46ce5ac667513bac88c0bd459115f236 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="mdescLeft"> </td><td class="mdescRight">Enable exceptions from the object. <br /></td></tr>
<tr class="separator:a46ce5ac667513bac88c0bd459115f236 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4e1a95b8d3c97338c66f21c5d5a4be20 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memItemLeft" align="right" valign="top"><a id="a4e1a95b8d3c97338c66f21c5d5a4be20"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1OptionalExceptions.html#a4e1a95b8d3c97338c66f21c5d5a4be20">disable_exceptions</a> () const</td></tr>
<tr class="memdesc:a4e1a95b8d3c97338c66f21c5d5a4be20 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="mdescLeft"> </td><td class="mdescRight">Disable exceptions from the object. <br /></td></tr>
<tr class="separator:a4e1a95b8d3c97338c66f21c5d5a4be20 inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acac3ee271ab36b9f65e6c2110a04ffff inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memItemLeft" align="right" valign="top"><a id="acac3ee271ab36b9f65e6c2110a04ffff"></a>
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">throw_exceptions</a> () const</td></tr>
<tr class="memdesc:acac3ee271ab36b9f65e6c2110a04ffff inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if exceptions are enabled. <br /></td></tr>
<tr class="separator:acac3ee271ab36b9f65e6c2110a04ffff inherit pub_methods_classmysqlpp_1_1OptionalExceptions"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a3c2442a1e8f9210b23eb10d3c024d6df"><td class="memItemLeft" align="right" valign="top"><a id="a3c2442a1e8f9210b23eb10d3c024d6df"></a>
static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a3c2442a1e8f9210b23eb10d3c024d6df">thread_aware</a> ()</td></tr>
<tr class="memdesc:a3c2442a1e8f9210b23eb10d3c024d6df"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if both MySQL++ and database driver we're using were compiled with thread awareness. <br /></td></tr>
<tr class="separator:a3c2442a1e8f9210b23eb10d3c024d6df"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a63d89963e63c74fe0dcb0eb00a5a8cbd"><td class="memItemLeft" align="right" valign="top"><a id="a63d89963e63c74fe0dcb0eb00a5a8cbd"></a>
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a63d89963e63c74fe0dcb0eb00a5a8cbd">thread_end</a> ()</td></tr>
<tr class="memdesc:a63d89963e63c74fe0dcb0eb00a5a8cbd"><td class="mdescLeft"> </td><td class="mdescRight">Tells the underlying database driver that this thread is done using the library. <br /></td></tr>
<tr class="separator:a63d89963e63c74fe0dcb0eb00a5a8cbd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aade1534fea22a5d1e2f315515f23f880"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#aade1534fea22a5d1e2f315515f23f880">thread_start</a> ()</td></tr>
<tr class="memdesc:aade1534fea22a5d1e2f315515f23f880"><td class="mdescLeft"> </td><td class="mdescRight">Tells the underlying database driver that the current thread is now using its services. <a href="#aade1534fea22a5d1e2f315515f23f880">More...</a><br /></td></tr>
<tr class="separator:aade1534fea22a5d1e2f315515f23f880"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a3dcec3b1e9a1aa6efb287bc9ec11f7d5"><td class="memItemLeft" align="right" valign="top"><a id="a3dcec3b1e9a1aa6efb287bc9ec11f7d5"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a3dcec3b1e9a1aa6efb287bc9ec11f7d5">build_error_message</a> (const char *core)</td></tr>
<tr class="memdesc:a3dcec3b1e9a1aa6efb287bc9ec11f7d5"><td class="mdescLeft"> </td><td class="mdescRight">Build an error message in the standard form used whenever one of the methods can't succeed because we're not connected to the database server. <br /></td></tr>
<tr class="separator:a3dcec3b1e9a1aa6efb287bc9ec11f7d5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a44070d9f1bee49126320ad815a854ed3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#a44070d9f1bee49126320ad815a854ed3">copy</a> (const <a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> &other)</td></tr>
<tr class="memdesc:a44070d9f1bee49126320ad815a854ed3"><td class="mdescLeft"> </td><td class="mdescRight">Establish a new connection as a copy of an existing one. <a href="#a44070d9f1bee49126320ad815a854ed3">More...</a><br /></td></tr>
<tr class="separator:a44070d9f1bee49126320ad815a854ed3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad9724a5edab5db2c7a71fdccfe124cb5"><td class="memItemLeft" align="right" valign="top"><a id="ad9724a5edab5db2c7a71fdccfe124cb5"></a>
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#ad9724a5edab5db2c7a71fdccfe124cb5">parse_ipc_method</a> (const char *server, std::string &host, unsigned int &port, std::string &socket_name)</td></tr>
<tr class="memdesc:ad9724a5edab5db2c7a71fdccfe124cb5"><td class="mdescLeft"> </td><td class="mdescRight">Extract elements from the server parameter in formats suitable for passing to <a class="el" href="classmysqlpp_1_1DBDriver.html#adbd9ba43e74fca9c46dbe85ea8657c0f" title="Establish a new connection using the same parameters as an existing connection.">DBDriver::connect()</a>. <br /></td></tr>
<tr class="separator:ad9724a5edab5db2c7a71fdccfe124cb5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pro_methods_classmysqlpp_1_1OptionalExceptions"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classmysqlpp_1_1OptionalExceptions')"><img src="closed.png" alt="-"/> Protected Member Functions inherited from <a class="el" href="classmysqlpp_1_1OptionalExceptions.html">mysqlpp::OptionalExceptions</a></td></tr>
<tr class="memitem:a5e4f4a7a1526ceaef3308a385bd28a10 inherit pro_methods_classmysqlpp_1_1OptionalExceptions"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1OptionalExceptions.html#a5e4f4a7a1526ceaef3308a385bd28a10">set_exceptions</a> (bool e) const</td></tr>
<tr class="memdesc:a5e4f4a7a1526ceaef3308a385bd28a10 inherit pro_methods_classmysqlpp_1_1OptionalExceptions"><td class="mdescLeft"> </td><td class="mdescRight">Sets the exception state to a particular value. <a href="classmysqlpp_1_1OptionalExceptions.html#a5e4f4a7a1526ceaef3308a385bd28a10">More...</a><br /></td></tr>
<tr class="separator:a5e4f4a7a1526ceaef3308a385bd28a10 inherit pro_methods_classmysqlpp_1_1OptionalExceptions"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:affbdf4dd97aa66cfa592fc85938faf41"><td class="memItemLeft" align="right" valign="top"><a id="affbdf4dd97aa66cfa592fc85938faf41"></a>
std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a></td></tr>
<tr class="memdesc:affbdf4dd97aa66cfa592fc85938faf41"><td class="mdescLeft"> </td><td class="mdescRight">MySQL++ specific error, if any. <br /></td></tr>
<tr class="separator:affbdf4dd97aa66cfa592fc85938faf41"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Manages the connection to the database server. </p>
<p>This class is a thick wrapper around <a class="el" href="classmysqlpp_1_1DBDriver.html" title="Provides a thin abstraction layer over the underlying database client library.">DBDriver</a>, adding high-level error handling, utility functions, and abstraction away from underlying C API details. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a0053ef79210079a5579e55a12fe5f10a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0053ef79210079a5579e55a12fe5f10a">◆ </a></span>Connection() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mysqlpp::Connection::Connection </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>te</em> = <code>true</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create object without connecting to the database server. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">te</td><td>if true, exceptions are thrown on errors </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a382ec4947dbb1998833ad0fc6f93d1c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a382ec4947dbb1998833ad0fc6f93d1c9">◆ </a></span>Connection() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mysqlpp::Connection::Connection </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>db</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>server</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>user</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>password</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"><em>port</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create object and connect to database server in one step. </p>
<p>This constructor allows you to most fully specify the options used when connecting to the database server.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">db</td><td>name of database to select upon connection </td></tr>
<tr><td class="paramname">server</td><td>specifies the IPC method and parameters for contacting the server; see below for details </td></tr>
<tr><td class="paramname">user</td><td>user name to log in under, or 0 to use the user name this program is running under </td></tr>
<tr><td class="paramname">password</td><td>password to use when logging in </td></tr>
<tr><td class="paramname">port</td><td>TCP port number database server is listening on, or 0 to use default value; note that you may also give this as part of the <code>server</code> parameter</td></tr>
</table>
</dd>
</dl>
<p>The server parameter can be any of several different forms:</p>
<ul>
<li><b>0</b>: Let the database driver decide how to connect; usually some sort of localhost IPC method.</li>
<li><b>"."</b>: On Windows, this means named pipes, if the server supports it</li>
<li><b>"/some/domain/socket/path"</b>: If the passed string doesn't match one of the previous alternatives and we're on a system that supports Unix domain sockets, MySQL++ will test it to see if it names one, and use it if we have permission.</li>
<li><b>"host.name.or.ip:port"</b>: If the previous test fails, or if the system doesn't support Unix domain sockets at all, it assumes the string is some kind of network address, optionally followed by a colon and port. The name can be in dotted quad form, a host name, or a domain name. The port can either be a TCP/IP port number or a symbolic service name. If a port or service name is given here and a nonzero value is passed for the <code>port</code> parameter, the latter takes precedence. </li>
</ul>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#aa8e2b54058f7ff7c480e34129a8ee212">connect()</a>.</p>
</div>
</div>
<a id="a23e80d1b3fee58e8771b2a6dd3c9ac3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a23e80d1b3fee58e8771b2a6dd3c9ac3f">◆ </a></span>Connection() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mysqlpp::Connection::Connection </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> & </td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Establish a new connection using the same parameters as an existing connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>existing <a class="el" href="classmysqlpp_1_1Connection.html" title="Manages the connection to the database server.">Connection</a> object </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#a44070d9f1bee49126320ad815a854ed3">copy()</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa8e2b54058f7ff7c480e34129a8ee212"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8e2b54058f7ff7c480e34129a8ee212">◆ </a></span>connect()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::connect </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>db</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>server</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>user</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>password</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"><em>port</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Connect to database after object is created. </p>
<p>It's better to use the connect-on-create constructor if you can. See its documentation for the meaning of these parameters.</p>
<p>If you call this method on an object that is already connected to a database server, the previous connection is dropped and a new connection is established. </p>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#adbd9ba43e74fca9c46dbe85ea8657c0f">mysqlpp::DBDriver::connect()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#a3cb1bf601b19dbb87b36bed4590f4214">errnum()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#abe12a159a0a05fbd6c9ade18cea39246">error()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, <a class="el" href="classmysqlpp_1_1Connection.html#ad9724a5edab5db2c7a71fdccfe124cb5">parse_ipc_method()</a>, and <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classmysqlpp_1_1Connection.html#a382ec4947dbb1998833ad0fc6f93d1c9">Connection()</a>.</p>
</div>
</div>
<a id="ac9e310f5c544a7aec143c02f4618ff69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9e310f5c544a7aec143c02f4618ff69">◆ </a></span>connected()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::connected </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if connection was established successfully. </p>
<dl class="section return"><dt>Returns</dt><dd>true if connection was established successfully </dd></dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#a78a43a4917343e9bc4b9ce535aea1f0b">mysqlpp::DBDriver::connected()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classmysqlpp_1_1Connection.html#ac1dbc411f7ab1debbabe241561fe4091">ping()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#af1bd6c380dea4cf157e4de7295550a0c">select_db()</a>, and <a class="el" href="classmysqlpp_1_1Connection.html#a8fed0ebc10f72fe591941dc6f64b6f20">shutdown()</a>.</p>
</div>
</div>
<a id="a44070d9f1bee49126320ad815a854ed3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44070d9f1bee49126320ad815a854ed3">◆ </a></span>copy()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mysqlpp::Connection::copy </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> & </td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Establish a new connection as a copy of an existing one. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>the connection to copy </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#a3eb75725a72627f5a51667323c555ff5">mysqlpp::DBDriver::copy()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#a5e4f4a7a1526ceaef3308a385bd28a10">mysqlpp::OptionalExceptions::set_exceptions()</a>, and <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classmysqlpp_1_1Connection.html#a23e80d1b3fee58e8771b2a6dd3c9ac3f">Connection()</a>, and <a class="el" href="classmysqlpp_1_1Connection.html#aaf58375723c00a4ac494c83ab384596e">operator=()</a>.</p>
</div>
</div>
<a id="a71356d1ca53c988bf9f1e1946e4a7f48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71356d1ca53c988bf9f1e1946e4a7f48">◆ </a></span>count_rows()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ulonglong mysqlpp::Connection::count_rows </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>table</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of rows in a table. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">table</td><td>name of table whose rows you want counted</td></tr>
</table>
</dd>
</dl>
<p>This is syntactic sugar for a <code>SELECT</code> <code>COUNT(*)</code> <code>FROM</code> <code>table</code> SQL query. </p>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, <a class="el" href="classmysqlpp_1_1Query.html#a16c800e645429d558f4295065b1aed73">mysqlpp::Query::store()</a>, and <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
</div>
</div>
<a id="ac9852fb87572c6f10c6de051bacf6b8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9852fb87572c6f10c6de051bacf6b8d">◆ </a></span>create_db()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::create_db </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>db</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Ask the database server to create a database. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">db</td><td>name of database to create</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if database was created successfully </dd></dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, <a class="el" href="classmysqlpp_1_1Query.html#a23057cc385f9645d7d7ef00aecc2c8ba">mysqlpp::Query::exec()</a>, and <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
</div>
</div>
<a id="aa073e784a16a9d4b357740a626a6b2e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa073e784a16a9d4b357740a626a6b2e1">◆ </a></span>drop_db()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::drop_db </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>db</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Asks the database server to drop (destroy) a database. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">db</td><td>name of database to destroy</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if database was dropped successfully </dd></dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, <a class="el" href="classmysqlpp_1_1Query.html#a23057cc385f9645d7d7ef00aecc2c8ba">mysqlpp::Query::exec()</a>, and <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
</div>
</div>
<a id="abe12a159a0a05fbd6c9ade18cea39246"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe12a159a0a05fbd6c9ade18cea39246">◆ </a></span>error()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char * mysqlpp::Connection::error </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return error message for last error associated with this connection. </p>
<p>Returns either a MySQL++-specific error message if one exists, or one from the current database driver otherwise. </p>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#a649df7e2b57192734dcd7ba05b80af20">mysqlpp::DBDriver::error()</a>, and <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>.</p>
<p class="reference">Referenced by <a class="el" href="classmysqlpp_1_1Connection.html#aa8e2b54058f7ff7c480e34129a8ee212">connect()</a>, <a class="el" href="classmysqlpp_1_1Query.html#a7f0ac13c968f3c662205d1f8af415cb3">mysqlpp::Query::error()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#af1bd6c380dea4cf157e4de7295550a0c">select_db()</a>, and <a class="el" href="classmysqlpp_1_1Connection.html#a8fed0ebc10f72fe591941dc6f64b6f20">shutdown()</a>.</p>
</div>
</div>
<a id="acdd753570fdc8239f0aa1f3160673272"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acdd753570fdc8239f0aa1f3160673272">◆ </a></span>ipc_info()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string mysqlpp::Connection::ipc_info </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get information about the IPC connection to the database server. </p>
<p><a class="el" href="classmysqlpp_1_1String.html" title="A std::string work-alike that can convert itself from SQL text data formats to C++ data types.">String</a> contains info about type of connection (e.g. TCP/IP, named pipe, Unix socket...) and the server hostname. </p>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#aa69862fc8ab2ddfc3169b0af7c3ccd47">mysqlpp::DBDriver::ipc_info()</a>.</p>
</div>
</div>
<a id="a8d934ece7ac0fdc7341022f7af75225f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d934ece7ac0fdc7341022f7af75225f">◆ </a></span>kill()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::kill </td>
<td>(</td>
<td class="paramtype">unsigned long </td>
<td class="paramname"><em>tid</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Kill a database server thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">tid</td><td>ID of thread to kill</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classmysqlpp_1_1Connection.html#a60c43e10eb9db82c075443add56785ce" title="Returns the database server's thread ID for this connection.">thread_id()</a> </dd></dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, and <a class="el" href="classmysqlpp_1_1DBDriver.html#abef4b00d04388bd13a410e378b06950a">mysqlpp::DBDriver::kill()</a>.</p>
</div>
</div>
<a id="ac566c5ccf8cf92d3b80969bd09bea184"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac566c5ccf8cf92d3b80969bd09bea184">◆ </a></span>operator private_bool_type()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">mysqlpp::Connection::operator private_bool_type </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Test whether any error has occurred within the object. </p>
<p>Allows the object to be used in bool context, like this:</p>
<div class="fragment"><div class="line"><a class="code" href="classmysqlpp_1_1Connection.html#a0053ef79210079a5579e55a12fe5f10a">Connection</a> conn;</div><div class="line">.... use conn</div><div class="line"><span class="keywordflow">if</span> (conn) {</div><div class="line"> ... nothing bad has happened since last successful use</div><div class="line">}</div><div class="line"><span class="keywordflow">else</span> {</div><div class="line"> ... some <a class="code" href="classmysqlpp_1_1Connection.html#abe12a159a0a05fbd6c9ade18cea39246">error</a> has occurred</div><div class="line">}</div></div><!-- fragment --><p>Prior to MySQL++ v3, the object was always falsy when we weren't connected. Now a true return simply indicates a lack of errors. If you've been using this to test for whether the connection is still up, you need to call <a class="el" href="classmysqlpp_1_1Connection.html#ac9e310f5c544a7aec143c02f4618ff69" title="Returns true if connection was established successfully.">connected()</a> instead. </p>
</div>
</div>
<a id="ac1dbc411f7ab1debbabe241561fe4091"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1dbc411f7ab1debbabe241561fe4091">◆ </a></span>ping()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::ping </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>"Pings" the database server </p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>if server is responding </td></tr>
<tr><td class="paramname">false</td><td>if either we already know the connection is down and cannot re-establish it, or if the server did not respond to the ping and we could not re-establish the connection. </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#a3dcec3b1e9a1aa6efb287bc9ec11f7d5">build_error_message()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#ac9e310f5c544a7aec143c02f4618ff69">connected()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, and <a class="el" href="classmysqlpp_1_1DBDriver.html#afb313dbd435e6cef84e00e5e803e458d">mysqlpp::DBDriver::ping()</a>.</p>
</div>
</div>
<a id="a6954d437d52004915fbc96a0be79ab37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6954d437d52004915fbc96a0be79ab37">◆ </a></span>query() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmysqlpp_1_1Query.html">Query</a> mysqlpp::Connection::query </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>qstr</em> = <code>0</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Return a new query object. </p>
<p>The returned query object is tied to this connection object, so when you call a method like <a class="el" href="classmysqlpp_1_1Query.html#a03ee1b9e393d88de946f5be804ea88cf">execute() </a> on that object, the query is sent to the server this object is connected to.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">qstr</td><td>an optional query string for populating the new <a class="el" href="classmysqlpp_1_1Query.html" title="A class for building and executing SQL queries.">Query</a> object </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classmysqlpp_1_1Transaction.html#a109bd0f1d70b6ff69cf3abccf7eea8f8">mysqlpp::Transaction::commit()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#af7aaad10bb2f08cae4384f5c227c0f19">query()</a>, <a class="el" href="classmysqlpp_1_1Transaction.html#a000e4f0882139eb8470f7472ca14a24e">mysqlpp::Transaction::rollback()</a>, and <a class="el" href="classmysqlpp_1_1Transaction.html#a5472100c371746d23311bbd74067c5dc">mysqlpp::Transaction::Transaction()</a>.</p>
</div>
</div>
<a id="af7aaad10bb2f08cae4384f5c227c0f19"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7aaad10bb2f08cae4384f5c227c0f19">◆ </a></span>query() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmysqlpp_1_1Query.html">Query</a> mysqlpp::Connection::query </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>qstr</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Return a new query object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">qstr</td><td>initial query string </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#a6954d437d52004915fbc96a0be79ab37">query()</a>.</p>
</div>
</div>
<a id="af1bd6c380dea4cf157e4de7295550a0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af1bd6c380dea4cf157e4de7295550a0c">◆ </a></span>select_db()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::select_db </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>db</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Change to a different database managed by the database server we are connected to. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">db</td><td>database to switch to</td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>if we changed databases successfully </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1Connection.html#a3dcec3b1e9a1aa6efb287bc9ec11f7d5">build_error_message()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#ac9e310f5c544a7aec143c02f4618ff69">connected()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#a3cb1bf601b19dbb87b36bed4590f4214">errnum()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#abe12a159a0a05fbd6c9ade18cea39246">error()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, <a class="el" href="classmysqlpp_1_1DBDriver.html#a9b04fc35e69c50a11fed637f94474918">mysqlpp::DBDriver::select_db()</a>, and <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
</div>
</div>
<a id="a266f69b0e8d9d588e8cc6c5a2a897b87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a266f69b0e8d9d588e8cc6c5a2a897b87">◆ </a></span>set_option()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::set_option </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmysqlpp_1_1Option.html">Option</a> * </td>
<td class="paramname"><em>o</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets a connection option. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">o</td><td>pointer to any derivative of <a class="el" href="classmysqlpp_1_1Option.html" title="Define abstract interface for all *Option subclasses.">Option</a> allocated on the heap</td></tr>
</table>
</dd>
</dl>
<p>Objects passed to this method and successfully set will be released when this <a class="el" href="classmysqlpp_1_1Connection.html" title="Manages the connection to the database server.">Connection</a> object is destroyed. If an error occurs while setting the option the object will be deleted immediately.</p>
<p>Because there are so many <a class="el" href="classmysqlpp_1_1Option.html" title="Define abstract interface for all *Option subclasses.">Option</a> subclasses, the actual effect of this function has a wide range. This mechanism abstracts away many things that are unrelated down at the database driver level, hiding them behind a coherent, type-safe interface.</p>
<p>The rules about which options can be set, when, are up to the underlying database driver. Some must be set before the connection is established because they can only be used during that connection setup process. Others can be set at any time after the connection comes up. If you get it wrong, you'll get a <a class="el" href="classmysqlpp_1_1BadOption.html" title="Exception thrown when you pass an unrecognized option to Connection::set_option().">BadOption</a> exception.</p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>if option was successfully set </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#a649df7e2b57192734dcd7ba05b80af20">mysqlpp::DBDriver::error()</a>, <a class="el" href="classmysqlpp_1_1Connection.html#affbdf4dd97aa66cfa592fc85938faf41">error_message_</a>, <a class="el" href="classmysqlpp_1_1DBDriver.html#a7e904fea92e008b62dc029a4edc64b14">mysqlpp::DBDriver::set_option()</a>, and <a class="el" href="classmysqlpp_1_1OptionalExceptions.html#acac3ee271ab36b9f65e6c2110a04ffff">mysqlpp::OptionalExceptions::throw_exceptions()</a>.</p>
</div>
</div>
<a id="a60c43e10eb9db82c075443add56785ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60c43e10eb9db82c075443add56785ce">◆ </a></span>thread_id()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned long mysqlpp::Connection::thread_id </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the database server's thread ID for this connection. </p>
<p>This has nothing to do with threading on the client side. The only thing you can do with this value is pass it to <a class="el" href="classmysqlpp_1_1Connection.html#a8d934ece7ac0fdc7341022f7af75225f" title="Kill a database server thread.">kill()</a>. </p>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#a9c73ac21eb910ee9a28e41a8dad453bc">mysqlpp::DBDriver::thread_id()</a>.</p>
</div>
</div>
<a id="aade1534fea22a5d1e2f315515f23f880"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aade1534fea22a5d1e2f315515f23f880">◆ </a></span>thread_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::Connection::thread_start </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Tells the underlying database driver that the current thread is now using its services. </p>
<p>It's not necessary to call this from the thread that creates the connection as it's done automatically. This method exists for times when multiple threads may use this object; it allows the underlying database driver to set up any per-thread data structures it needs.</p>
<p>The MySQL++ user manual's <a href="../userman/threads.html">chapter on threads</a> details two major strategies for dealing with connections in the face of threads. The Connection-per-thread option frees you from ever having to call this method. The other documented strategy is to use <a class="el" href="classmysqlpp_1_1ConnectionPool.html" title="Manages a pool of connections for programs that need more than one Connection object at a time,...">ConnectionPool</a>, which opens the possibility for one thread to create a connection that another uses, so you do need to call this method in that case, or with any other similar strategy.</p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">True</td><td>if there was no problem </td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1DBDriver.html#affae19fda3fc1a8b25e9725e9aa41fe7">mysqlpp::DBDriver::thread_start()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="connection_8h_source.html">connection.h</a></li>
<li>connection.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Jul 21 2019 05:32:21 for MySQL++ by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
|