![](https://csdnimg.cn/release/download_crawler_static/80034810/bg1.jpg)
MySQL++ v3.3.0 User Manual
Kevin Atkinson
Sinisa Milivojevic
Monty Widenius
Warren Young
Copyright © 1998-2001, 2005-2019 Kevin Atkinson (original author), MySQL AB, Educational Technology
Resources
April 28, 2021
Table of Contents
1. Introduction .................................................................................................................................... 3
1.1. A Brief History of MySQL++ .................................................................................................. 3
1.2. If You Have Questions... ......................................................................................................... 4
2. Overview ....................................................................................................................................... 5
2.1. The Connection Object ........................................................................................................... 5
2.2. The Query Object .................................................................................................................. 5
2.3. Result Sets ........................................................................................................................... 5
2.4. Exceptions ........................................................................................................................... 7
3. Tutorial .......................................................................................................................................... 8
3.1. Running the Examples ............................................................................................................ 8
3.2. A Simple Example ................................................................................................................. 9
3.3. A More Complicated Example ................................................................................................ 10
3.4. Exceptions .......................................................................................................................... 11
3.5. Quoting and Escaping ........................................................................................................... 12
3.6. C++ vs. SQL Data Types ....................................................................................................... 13
3.7. Handling SQL Nulls ............................................................................................................. 15
3.8. MySQL++’s Special String Types ........................................................................................... 16
3.9. Dealing with Binary Data ...................................................................................................... 17
3.10. Using Transactions ............................................................................................................. 22
3.11. Which Query Type to Use? .................................................................................................. 25
3.12. Conditional Result Row Handling ......................................................................................... 27
3.13. Executing Code for Each Row In a Result Set .......................................................................... 29
3.14. Connection Options ............................................................................................................ 30
3.15. Dealing with Connection Timeouts ........................................................................................ 34
3.16. Concurrent Queries on a Connection ...................................................................................... 35
3.17. Getting Field Meta-Information ............................................................................................ 35
4. Template Queries ........................................................................................................................... 38
4.1. Setting up Template Queries .................................................................................................. 39
4.2. Setting the Parameters at Execution Time ................................................................................. 40
4.3. Default Parameters ............................................................................................................... 40
4.4. Error Handling .................................................................................................................... 41
5. Specialized SQL Structures .............................................................................................................. 42
5.1. sql_create ........................................................................................................................... 42
5.2. SSQLS Comparison and Initialization ...................................................................................... 43
5.3. Retrieving data .................................................................................................................... 44
5.4. Adding data ........................................................................................................................ 46
1
评论0