Fix mysql includes 1.0.5 with mac, didn't work with mysql 1.1.0

This commit is contained in:
GreYFoXGTi 2010-10-26 20:02:12 +02:00
parent c6162b6485
commit 15f9878d25
23 changed files with 2400 additions and 0 deletions

16
bam.lua
View file

@ -147,6 +147,22 @@ function build(settings)
if platform == "macosx" then
settings.link.frameworks:Add("Carbon")
settings.link.frameworks:Add("AppKit")
settings.cc.includes:Add("other/mysql/mac/include")
settings.cc.includes:Add("other/mysql/mac/include/cppconn") -- this next part has to be wrong but i don't know how else to do it any way it will end up taking ppc 32 bit
if arch == "ppc" then
if arch == "amd64" then
settings.link.libpath:Add("other/mysql/mac/libppc64")
else
settings.link.libpath:Add("other/mysql/mac/libppc32")
end
else
if arch == "amd64" then
settings.link.libpath:Add("other/mysql/mac/lib64")
else
settings.link.libpath:Add("other/mysql/mac/lib32")
end
end
settings.link.libs:Add("mysqlcppconn-static")
else
settings.link.libs:Add("pthread")
settings.cc.includes:Add("other/mysql/include")

View file

@ -0,0 +1,88 @@
Dear MySQL Users,
A new GA (general availability) version of MySQL Connector/C++ has been
made available: MySQL Connector/C++ 1.1.0 GA. The MySQL Connector/C++
provides a C++ API for connecting client applications to the
MySQL Server 5.1 or newer. You can download the production release at:
http://dev.mysql.com/downloads/connector/cpp/1.0.html
LICENSE
MySQL Connector/C++ is licensed under the GPLv2 or a commercial
license from Oracle Corporation.
If you have licensed this product under the GPLv2, please see the
COPYING file for more information.
There are special exceptions to the terms and conditions of the
GPLv2 as it is applied to this software, see the FLOSS License
Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
For Licensing questions, and to purchase MySQL Products and Services,
please contact an Oracle sales representative:
http://www.mysql.com/about/contact/sales.html?s=oem
====
The MySQL driver for C++ offers an easy to use API derived from JDBC
4.0. We use the MySQL Connector/C++ in two of our own products. A
development version of MySQL Workbench is using it successfully since
months. MySQL Connector/OpenOffice.org, an OpenOffice.org 3.1
extension, is a thin wrapper around the MySQL driver for C++.
The major feature addition in version 1.1.0 is run-time dynamic
loading of the MYSQL Client Library. You can choose to link the MySQL
Client Library (C-API) at compile time, which has been the default in
the past and is still the default in 1.1.0, or to use dynamic loading
at run-time. Run-time dynamic loading allows you to switch the client
library on a per connection basis and can be useful, if you need to
ensure that a certain version of the MySQL Client Library will be
used.
We have improved the driver and added a couple of new features since
the last beta release. Please see the documentation and the CHANGES
file in the source distribution for a detailed description of bugs
that have been fixed. Among others the following changes have been
made:
- Fixed bugs #45048, #45846, #45843, #44931, #36239
- Fixed bug in ResultSetMetaData for normal statements and prepared
ones, getScale() and getPrecision() did return wrong results.
- Fixed performance issue of Prepared Statements when reading large
result sets.
- API incompatible change: ConnectPropertyVal is no more a struct but
a typedef that uses boost::variant.
- Connection::getClientOption() now supports "metadataUseInfoSchema",
"defaultStatementResultType", "defaultPreparedStatementResultType"
and "characterSetResults".
- We make use of some Boost components (http://www.boost.org). For
compiling from source you need to have Boost 1.34.0 or newer
installed. There are no new dependencies for binary builds.
You can find further details, including usages examples, in the
documentation at:
http://dev.mysql.com/doc/refman/5.1/en/connector-cpp.html
The projects MySQL Forge wiki page is at:
http://forge.mysql.com/wiki/Connector_C%2B%2B
Feedback, bug reports, bug fixes, patches and so on are welcome and
appreciated:
http://forge.mysql.com/wiki/Contributing
You may also want to contribute to the MySQL Forum on C/C++ at
http://forums.mysql.com/list.php?167 or join the MySQL Connector/C++
mailing list http://lists.mysql.com/connector-cplusplus .
Enjoy!

343
other/mysql/mac/COPYING Normal file
View file

@ -0,0 +1,343 @@
GNU General Public License
**************************
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

324
other/mysql/mac/README Normal file
View file

@ -0,0 +1,324 @@
MySQL Connector/C++ mysql-connector-c++-1.1.0-osx10.5-x86-32bit
Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
CONTENTS
* Contact
* Installation
* Prerequisites for building Connector/C++
* Building on Unix
* Run CMake to build a Makefile
* Use make to build the libraries
* CMake options: MySQL installation path, debug version and more
* Building on Solaris
* Building on Windows
* Source layout
* (if binary package) Further Platform Notes on Building
CONTACT
For general discussion of the MySQL Connector/C++ please use the C/C++
community forum at http://forums.mysql.com/list.php?167 or join the MySQL
Connector/C++ mailing list at http://lists.mysql.com .
Bugs can be reported at http://bugs.mysql.com .
For sales related questions please write to <sales@mysql.com>.
See also http://forge.mysql.com/wiki/Connector_C%2B%2B .
INSTALLATION
The MySQL Driver for C++ is distributed in source and binary form.
The binary distributions are available as TAR.GZ archives for all
supported platforms but Windows. On Windows you either use a MSI Installer
or unpack a ZIP archive to an appropriate place.
Please check the Reference Manual for further information at:
http://dev.mysql.com/doc/refman/5.1/en/connector-cpp.html
Notes on building the driver from source can be found in the Reference
Manual and below. At the end of this file you may find settings
we have used to build a binary package for your platform.
PREREQUISITES FOR BUILDING CONNECTOR/C++
The MySQL Connector/C++ is based on the MySQL client libary (MySQL C API).
Connector C/C++ is linked against the MySQL client library. You need to have
the MySQL client library installed in order to compile the Connector/C++.
Typically the MySQL client library gets installed by installing
the MySQL Server. However, check your operating system documentation for
other installation options.
Alternatively you can install the new MySQL Connector/C. The MySQL Connector/C
is a standalone version of the MySQL client library.
You need to have CMake 2.6.2 (http://www.cmake.org).
NOTE: cmake binaries are available for most systems. You do not need to build
cmake yourself.
As of version 1.1.0 Connector/C++ makes use of Boost (http://www.boost.org).
You need to have Boost 1.34.0 or newer installed on your build system.
The MySQL driverfor C++ makes use of Boost variant, any and some pointers.
All of those are "headers only". When installing Boost on your system,
you can disable all components that require building any kind
of binaries.
BUILDING ON UNIX
The MySQL Connector/C++ is using the cross platform make CMake. CMake
creates classical Makefiles. Please visit http://www.cmake.org for
further information and documentation.
1. Run CMake to build a Makefile
me@host:/path/to/mysql-connector-cpp> cmake .
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- mysql_config was found /usr/bin/mysql_config
-- MySQL Include dir: /usr/include/mysql
-- MySQL Library :
-- MySQL Library dir: /usr/lib64/mysql;/usr/lib64
[...]
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/mysql-connector-cpp
Read on at point 3) in case of configure problems.
2. Use make to build the libraries
me@host:/path/to/mysql-connector-cpp> make clean
me@host:/path/to/mysql-connector-cpp> make
Scanning dependencies of target mysqlcppconn
[ 0%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/mysql_art_resultset.cpp.o
[ 1%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/mysql_art_rset_metadata.cpp.o
[ 2%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/mysql_connection.cpp.o
[...]
[100%] Building CXX object test/unit/template_bug_group/CMakeFiles/bug456.dir/bug456.o
Linking CXX executable bug456
If all goes well, you will find the Connector/C++ library in
/path/to/driver/libcppmysqlcppconn.so . In case of problems read on below
before you ask for assistance.
If you want to install the libraries on your system proceed with make install.
me@host:/path/to/mysql-connector-cpp> make install
3. CMake options: MySQL installation path, debug version and more
In case of configure and/or compile problems check the list of CMake options:
me@host:/path/to/mysql-connector-cpp> cmake -L
[...]
CMAKE_BUILD_TYPE:STRING=
CMAKE_INSTALL_PREFIX:PATH=/usr/local
MYSQLCLIENT_STATIC_BINDING:BOOL=1
MYSQLCPPCONN_BUILD_EXAMPLES:BOOL=1
MYSQLCPPCONN_DT_RPATH:STRING=
MYSQLCPPCONN_DYNLOAD_MYSQL_LIB:FILEPATH=/usr/lib64/libmysqlclient_r.so
MYSQLCPPCONN_GCOV_ENABLE:BOOL=0
MYSQLCPPCONN_ICU_ENABLE:BOOL=0
MYSQLCPPCONN_STLPORT_ENABLE:BOOL=0
MYSQLCPPCONN_TEST_NOT_IMPLEMENTED:BOOL=0
MYSQLCPPCONN_TRACE_ENABLE:BOOL=0
MYSQL_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/mysql_config
You may also try cmake -LA to get a list of all options including
the advanced options.
For example, if your MySQL Server installation path is not /usr/local/mysql
and you want to build a debug version of the MySQL Connector/C++ use:
me@host:/path/to/mysql-connector-cpp>
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DMYSQL_CONFIG_EXECUTABLE:FILEPATH=/path/to/my/mysql/server/bin/mysql_config .
Verify your settings with cmake -L:
me@host:/path/to/mysql-connector-cpp> cmake -L
[...]
CMAKE_BUILD_TYPE:STRING=
CMAKE_INSTALL_PREFIX:PATH=/usr/local
MYSQLCLIENT_STATIC_BINDING:BOOL=1
MYSQLCPPCONN_BUILD_EXAMPLES:BOOL=1
MYSQLCPPCONN_DT_RPATH:STRING=
MYSQLCPPCONN_DYNLOAD_MYSQL_LIB:FILEPATH=/usr/lib64/libmysqlclient_r.so
MYSQLCPPCONN_GCOV_ENABLE:BOOL=0
MYSQLCPPCONN_ICU_ENABLE:BOOL=0
MYSQLCPPCONN_STLPORT_ENABLE:BOOL=0
MYSQLCPPCONN_TEST_NOT_IMPLEMENTED:BOOL=0
MYSQLCPPCONN_TRACE_ENABLE:BOOL=0
MYSQL_CONFIG_EXECUTABLE:FILEPATH=/path/to/my/mysql/server/bin/mysql_config
Procees with make clean; make as described at point 2.)
NOTE: cmake does cache settings in the file CMakeCache.txt.
Make sure that cmake does not use old and unwanted settings from
CMakeCache.txt. This may cause compile problems. If so, delete CMakeCache.txt,
configure custom settings with cmake -D, if any and try compiling again.
BUILDING ON SOLARIS
Use the Sun compiler to build the MySQL Connector/C++.
Ensure that your environment points cmake to the appropriate compiler
binaries. The binary distributions of the MySQL Server are build using Sun
compilers. The MySQL tool mysql_config returns compiler flags suitable for
Sun compilers but possibly not suitable for GCC.
If you plan to use GCC on Solaris to compile MySQL Connector/C++,
you might need to insert
SET(MYSQL_CXXFLAGS "")
at the end of the file /path/to/mysql-connector-cpp/FindMySQL.cm.
However, its recommended to use Sun Studio on Solaris.
No changes are required when using the Sun compilers!
Make sure that you do not mix Sun compilers with GNU compilers when building
the MySQL Connector/C++. For example, do not use GCC as a C compiler and
Sun CC as a C++ compiler. The linker might fail to link the results
from both compilers to one binary.
BUILDING ON WINDOWS
The MySQL Connector/C++ is using the cross platform make CMake. CMake
creates classical Makefiles. Please visit http://www.cmake.org for
further information and documentation.
You need to have the environment variables set for the Visual Studio
toolchain. Visual Studio includes a batch file to set these for you,
and installs a shortcut into the Start menu to open a command prompt
with these variables set.
You need to set MYSQL_DIR to point to where the MySQL server is
installed, using the short-style filenames:
set MYSQL_DIR=C:\PROGRA~1\MySQL\MYSQLS~1.0
Build Connector/C++ using the "cmake" command-line tool by doing the
following from the source root directory (in a command prompt window);
cmake -G "Visual Studio 8 2005"
This produces a project file that you can open with Visual Studio or
build from the command line with either of:
devenv.com MySQLCPPCONN.sln /build Release
devenv.com MySQLCPPCONN.sln /build RelWithDebInfo
To compile the "Debug" build, you must run set the cmake build type so
the correct version of the MySQL client libraries are used:
cmake -G "Visual Studio 8 2005" -DCMAKE_BUILD_TYPE=Debug
devenv.com MySQLCPPCONN.sln /build Debug
Upon completion; you will find the executables in the subdirectories of the
"bin" and "lib" directories.
Different versions of CMake come with different "generators". A generator
is the component of CMake that is responsible for writing the build files.
If, for example, cmake --help does not list a generator for
Visual Studio 9 2008, try a more recent version of CMake.
Connector C/C++ supports only Microsoft Visual Studio 2003 and above
on Windows.
SOURCE LAYOUT
The MySQL Connector/C++ distribution contains the following directories:
|-- cppconn <-- Header files of the public interface
|-- driver <-- Connector/C++ source code
|-- examples <-- Basic examples
|-- test <-- Tests, so to say: more examples
|-- thread <-- Thread abstaction, unused
--- win <-- Windows MSI Installer
FURTHER PLATFORM NOTES ON BUILDING
If this README file is contained in a binary package, you will see below
what settings we have used to create the biary.
If this README file is contained in a source package and, you have build
issues, please download a binary package for your platform and check
the platform specific notes found in its README.
LEGAL
***************************************************************************
The following software may be included in this product:
Boost c++ libraries
Use of any of this software is governed by the terms of the license below:
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
***************************************************************************
Below is information about how this specific binary was built:
======================================================================
CC, CXX, cmake and MySQL versions
======================================================================
C compiler : i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
C++ compiler : i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
CMake version : cmake version 2.6-patch 2
MySQL version : 5.1.46sp1
======================================================================
Environment, except PATH, HOME and USER
======================================================================
CC=gcc
CFLAGS=-O2 -g -arch i386 -fno-common
CONFIG_SHELL=/bin/bash
CPPFLAGS=-DNDEBUG
CXX=g++
CXXFLAGS=-O2 -g -arch i386 -fno-common -felide-constructors
LDFLAGS=-arch i386 -Wl,-search_paths_first
MACOSX_DEPLOYMENT_TARGET=10.2
SED=sed
======================================================================
End Of File
======================================================================

View file

@ -0,0 +1,36 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_BUILD_CONFIG_H_
#define _SQL_BUILD_CONFIG_H_
#ifndef CPPCONN_PUBLIC_FUNC
#if defined(_WIN32)
// mysqlcppconn_EXPORTS is added by cmake and defined for dynamic lib build only
#ifdef mysqlcppconn_EXPORTS
#define CPPCONN_PUBLIC_FUNC __declspec(dllexport)
#else
// this is for static build
#ifdef CPPCONN_LIB_BUILD
#define CPPCONN_PUBLIC_FUNC
#else
// this is for clients using dynamic lib
#define CPPCONN_PUBLIC_FUNC __declspec(dllimport)
#endif
#endif
#else
#define CPPCONN_PUBLIC_FUNC
#endif
#endif //#ifndef CPPCONN_PUBLIC_FUNC
#endif //#ifndef _SQL_BUILD_CONFIG_H_

View file

@ -0,0 +1,90 @@
/*
Copyright 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
// libmysql defines HAVE_STRTOUL (on win), so we have to follow different pattern in definitions names
// to avoid annoying warnings.
#define HAVE_FUNCTION_STRTOLD 1
#define HAVE_FUNCTION_STRTOLL 1
#define HAVE_FUNCTION_STRTOL 1
#define HAVE_FUNCTION_STRTOULL 1
#define HAVE_FUNCTION_STRTOUL 1
#define HAVE_FUNCTION_STRTOIMAX 1
#define HAVE_FUNCTION_STRTOUMAX 1
#define HAVE_STDINT_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_INT8_T 1
#define HAVE_UINT8_T 1
#define HAVE_INT16_T 1
#define HAVE_UINT16_T 1
#define HAVE_INT32_T 1
#define HAVE_UINT32_T 1
#define HAVE_INT32_T 1
#define HAVE_UINT32_T 1
#define HAVE_INT64_T 1
#define HAVE_UINT64_T 1
/* #undef HAVE_MS_INT8 */
/* #undef HAVE_MS_UINT8 */
/* #undef HAVE_MS_INT16 */
/* #undef HAVE_MS_UINT16 */
/* #undef HAVE_MS_INT32 */
/* #undef HAVE_MS_UINT32 */
/* #undef HAVE_MS_INT64 */
/* #undef HAVE_MS_UINT64 */
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#if defined(_WIN32) || defined(_WIN64)
#ifndef CPPCONN_DONT_TYPEDEF_MS_TYPES_TO_C99_TYPES
#ifdef HAVE_MS_INT8
typedef __int8 int8_t;
#endif
#ifdef HAVE_MS_UINT8
typedef unsigned __int8 uint8_t;
#endif
#ifdef HAVE_MS_INT16
typedef __int16 int16_t;
#endif
#ifdef HAVE_MS_UINT16
typedef unsigned __int16 uint16_t;
#endif
#ifdef HAVE_MS_INT32
typedef __int32 int32_t;
#endif
#ifdef HAVE_MS_UINT32
typedef unsigned __int32 uint32_t;
#endif
#ifdef HAVE_MS_INT64
typedef __int64 int64_t;
#endif
#ifdef HAVE_MS_UINT64
typedef unsigned __int64 uint64_t;
#endif
#endif // CPPCONN_DONT_TYPEDEF_MS_TYPES_TO_C99_TYPES
#endif // _WIN32

View file

@ -0,0 +1,133 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_CONNECTION_H_
#define _SQL_CONNECTION_H_
#include <string>
#include <map>
#include "build_config.h"
#include "warning.h"
namespace sql
{
typedef union _ConnectPropertyVal
{
struct
{
const char * val;
size_t len;
} str;
double dval;
long long lval;
bool bval;
void * pval;
} ConnectPropertyVal;
class DatabaseMetaData;
class PreparedStatement;
class Statement;
typedef enum transaction_isolation
{
TRANSACTION_NONE= 0,
TRANSACTION_READ_COMMITTED,
TRANSACTION_READ_UNCOMMITTED,
TRANSACTION_REPEATABLE_READ,
TRANSACTION_SERIALIZABLE
} enum_transaction_isolation;
class Savepoint
{
/* Prevent use of these */
Savepoint(const Savepoint &);
void operator=(Savepoint &);
public:
Savepoint() {};
virtual ~Savepoint() {};
virtual int getSavepointId() = 0;
virtual std::string getSavepointName() = 0;
};
class CPPCONN_PUBLIC_FUNC Connection
{
/* Prevent use of these */
Connection(const Connection &);
void operator=(Connection &);
public:
Connection() {};
virtual ~Connection() {};
virtual void clearWarnings() = 0;
virtual Statement *createStatement() = 0;
virtual void close() = 0;
virtual void commit() = 0;
virtual bool getAutoCommit() = 0;
virtual std::string getCatalog() = 0;
virtual std::string getSchema() = 0;
virtual std::string getClientInfo() = 0;
virtual void getClientOption(const std::string & optionName, void * optionValue) = 0;
/* virtual int getHoldability() = 0; */
/* virtual std::map getTypeMap() = 0; */
virtual DatabaseMetaData * getMetaData() = 0;
virtual enum_transaction_isolation getTransactionIsolation() = 0;
virtual const SQLWarning * getWarnings() = 0;
virtual bool isClosed() = 0;
virtual std::string nativeSQL(const std::string& sql) = 0;
virtual PreparedStatement * prepareStatement(const std::string& sql) = 0;
virtual void releaseSavepoint(Savepoint * savepoint) = 0;
virtual void rollback() = 0;
virtual void rollback(Savepoint * savepoint) = 0;
virtual void setAutoCommit(bool autoCommit) = 0;
virtual void setCatalog(const std::string& catalog) = 0;
virtual void setSchema(const std::string& catalog) = 0;
virtual sql::Connection * setClientOption(const std::string & optionName, const void * optionValue) = 0;
virtual Savepoint * setSavepoint(const std::string& name) = 0;
virtual void setTransactionIsolation(enum_transaction_isolation level) = 0;
/* virtual void setTypeMap(Map map) = 0; */
};
} /* namespace sql */
#endif // _SQL_CONNECTION_H_

View file

@ -0,0 +1,53 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_DATATYPE_H_
#define _SQL_DATATYPE_H_
namespace sql
{
class DataType
{
DataType();
public:
enum {
UNKNOWN = 0,
BIT,
TINYINT,
SMALLINT,
MEDIUMINT,
INTEGER,
BIGINT,
REAL,
DOUBLE,
DECIMAL,
NUMERIC,
CHAR,
BINARY,
VARCHAR,
VARBINARY,
LONGVARCHAR,
LONGVARBINARY,
TIMESTAMP,
DATE,
TIME,
YEAR,
GEOMETRY,
ENUM,
SET,
SQLNULL
};
};
} /* namespace */
#endif /* _SQL_DATATYPE_H_ */

View file

@ -0,0 +1,50 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_DRIVER_H_
#define _SQL_DRIVER_H_
#include <string>
#include <map>
#include "connection.h"
#include "build_config.h"
namespace sql
{
class CPPCONN_PUBLIC_FUNC Driver
{
protected:
virtual ~Driver() {}
public:
// Attempts to make a database connection to the given URL.
virtual Connection * connect(const std::string& hostName, const std::string& userName, const std::string& password) = 0;
virtual Connection * connect(std::map< std::string, ConnectPropertyVal > & options) = 0;
virtual int getMajorVersion() = 0;
virtual int getMinorVersion() = 0;
virtual int getPatchVersion() = 0;
virtual const std::string & getName() = 0;
};
} /* namespace sql */
extern "C"
{
CPPCONN_PUBLIC_FUNC sql::Driver *get_driver_instance();
}
#endif /* _SQL_DRIVER_H_ */

View file

@ -0,0 +1,120 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_EXCEPTION_H_
#define _SQL_EXCEPTION_H_
#include "build_config.h"
#include <stdexcept>
#include <string>
#include <memory>
namespace sql
{
#define MEMORY_ALLOC_OPERATORS(Class) \
void* operator new(size_t size) throw (std::bad_alloc) { return ::operator new(size); } \
void* operator new(size_t, void*) throw(); \
void* operator new(size_t, const std::nothrow_t&) throw(); \
void* operator new[](size_t) throw (std::bad_alloc); \
void* operator new[](size_t, void*) throw(); \
void* operator new[](size_t, const std::nothrow_t&) throw(); \
void* operator new(size_t N, std::allocator<Class>&); \
virtual SQLException* copy() { return new Class(*this); }
#ifdef _WIN32
#pragma warning (disable : 4290)
//warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#pragma warning(push)
#pragma warning(disable: 4275)
#endif
class CPPCONN_PUBLIC_FUNC SQLException : public std::runtime_error
{
#ifdef _WIN32
#pragma warning(pop)
#endif
protected:
const std::string sql_state;
const int errNo;
public:
SQLException(const SQLException& e) : std::runtime_error(e.what()), sql_state(e.sql_state), errNo(e.errNo) {}
SQLException(const std::string& reason, const std::string& SQLState, int vendorCode) :
std::runtime_error (reason ),
sql_state (SQLState ),
errNo (vendorCode)
{}
SQLException(const std::string& reason, const std::string& SQLState) : std::runtime_error(reason), sql_state(SQLState), errNo(0) {}
SQLException(const std::string& reason) : std::runtime_error(reason), sql_state("HY000"), errNo(0) {}
SQLException() : std::runtime_error(""), sql_state("HY000"), errNo(0) {}
const char * getSQLState() const
{
return sql_state.c_str();
}
int getErrorCode() const
{
return errNo;
}
virtual ~SQLException() throw () {};
protected:
MEMORY_ALLOC_OPERATORS(SQLException)
};
struct CPPCONN_PUBLIC_FUNC MethodNotImplementedException : public SQLException
{
MethodNotImplementedException(const MethodNotImplementedException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
MethodNotImplementedException(const std::string& reason) : SQLException(reason, "", 0) {}
private:
virtual SQLException* copy() { return new MethodNotImplementedException(*this); }
};
struct CPPCONN_PUBLIC_FUNC InvalidArgumentException : public SQLException
{
InvalidArgumentException(const InvalidArgumentException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
InvalidArgumentException(const std::string& reason) : SQLException(reason, "", 0) {}
private:
virtual SQLException* copy() { return new InvalidArgumentException(*this); }
};
struct CPPCONN_PUBLIC_FUNC InvalidInstanceException : public SQLException
{
InvalidInstanceException(const InvalidInstanceException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
InvalidInstanceException(const std::string& reason) : SQLException(reason, "", 0) {}
private:
virtual SQLException* copy() { return new InvalidInstanceException(*this); }
};
struct CPPCONN_PUBLIC_FUNC NonScrollableException : public SQLException
{
NonScrollableException(const NonScrollableException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
NonScrollableException(const std::string& reason) : SQLException(reason, "", 0) {}
private:
virtual SQLException* copy() { return new NonScrollableException(*this); }
};
} /* namespace sql */
#endif /* _SQL_EXCEPTION_H_ */

View file

@ -0,0 +1,450 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_METADATA_H_
#define _SQL_METADATA_H_
#include <string>
#include <list>
#include "datatype.h"
namespace sql
{
class ResultSet;
class DatabaseMetaData
{
protected:
virtual ~DatabaseMetaData() {}
public:
enum
{
attributeNoNulls = 0,
attributeNullable,
attributeNullableUnknown
};
enum
{
bestRowTemporary = 0,
bestRowTransaction,
bestRowSession
};
enum
{
bestRowUnknown = 0,
bestRowNotPseudo,
bestRowPseudo
};
enum
{
columnNoNulls = 0,
columnNullable,
columnNullableUnknown
};
enum
{
importedKeyCascade = 0,
importedKeyInitiallyDeferred,
importedKeyInitiallyImmediate,
importedKeyNoAction,
importedKeyNotDeferrable,
importedKeyRestrict,
importedKeySetDefault,
importedKeySetNull
};
enum
{
procedureColumnIn = 0,
procedureColumnInOut,
procedureColumnOut,
procedureColumnResult,
procedureColumnReturn,
procedureColumnUnknown,
procedureNoNulls,
procedureNoResult,
procedureNullable,
procedureNullableUnknown,
procedureResultUnknown,
procedureReturnsResult
};
enum
{
sqlStateSQL99 = 0,
sqlStateXOpen
};
enum
{
tableIndexClustered = 0,
tableIndexHashed,
tableIndexOther,
tableIndexStatistic
};
enum
{
versionColumnUnknown = 0,
versionColumnNotPseudo = 1,
versionColumnPseudo = 2
};
enum
{
typeNoNulls = 0,
typeNullable = 1,
typeNullableUnknown = 2
};
enum
{
typePredNone = 0,
typePredChar = 1,
typePredBasic= 2,
typeSearchable = 3
};
virtual bool allProceduresAreCallable() = 0;
virtual bool allTablesAreSelectable() = 0;
virtual bool dataDefinitionCausesTransactionCommit() = 0;
virtual bool dataDefinitionIgnoredInTransactions() = 0;
virtual bool deletesAreDetected(int type) = 0;
virtual bool doesMaxRowSizeIncludeBlobs() = 0;
virtual ResultSet * getAttributes(const std::string& catalog, const std::string& schemaPattern, const std::string& typeNamePattern, const std::string& attributeNamePattern) = 0;
virtual ResultSet * getBestRowIdentifier(const std::string& catalog, const std::string& schema, const std::string& table, int scope, bool nullable) = 0;
virtual ResultSet * getCatalogs() = 0;
virtual const std::string& getCatalogSeparator() = 0;
virtual const std::string& getCatalogTerm() = 0;
virtual ResultSet * getColumnPrivileges(const std::string& catalog, const std::string& schema, const std::string& table, const std::string& columnNamePattern) = 0;
virtual ResultSet * getColumns(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern, const std::string& columnNamePattern) = 0;
virtual Connection * getConnection() = 0;
virtual ResultSet * getCrossReference(const std::string& primaryCatalog, const std::string& primarySchema, const std::string& primaryTable, const std::string& foreignCatalog, const std::string& foreignSchema, const std::string& foreignTable) = 0;
virtual unsigned int getDatabaseMajorVersion() = 0;
virtual unsigned int getDatabaseMinorVersion() = 0;
virtual unsigned int getDatabasePatchVersion() = 0;
virtual const std::string& getDatabaseProductName() = 0;
virtual std::string getDatabaseProductVersion() = 0;
virtual int getDefaultTransactionIsolation() = 0;
virtual unsigned int getDriverMajorVersion() = 0;
virtual unsigned int getDriverMinorVersion() = 0;
virtual unsigned int getDriverPatchVersion() = 0;
virtual const std::string& getDriverName() = 0;
virtual const std::string& getDriverVersion() = 0;
virtual ResultSet * getExportedKeys(const std::string& catalog, const std::string& schema, const std::string& table) = 0;
virtual const std::string& getExtraNameCharacters() = 0;
virtual const std::string& getIdentifierQuoteString() = 0;
virtual ResultSet * getImportedKeys(const std::string& catalog, const std::string& schema, const std::string& table) = 0;
virtual ResultSet * getIndexInfo(const std::string& catalog, const std::string& schema, const std::string& table, bool unique, bool approximate) = 0;
virtual unsigned int getCDBCMajorVersion() = 0;
virtual unsigned int getCDBCMinorVersion() = 0;
virtual unsigned int getMaxBinaryLiteralLength() = 0;
virtual unsigned int getMaxCatalogNameLength() = 0;
virtual unsigned int getMaxCharLiteralLength() = 0;
virtual unsigned int getMaxColumnNameLength() = 0;
virtual unsigned int getMaxColumnsInGroupBy() = 0;
virtual unsigned int getMaxColumnsInIndex() = 0;
virtual unsigned int getMaxColumnsInOrderBy() = 0;
virtual unsigned int getMaxColumnsInSelect() = 0;
virtual unsigned int getMaxColumnsInTable() = 0;
virtual unsigned int getMaxConnections() = 0;
virtual unsigned int getMaxCursorNameLength() = 0;
virtual unsigned int getMaxIndexLength() = 0;
virtual unsigned int getMaxProcedureNameLength() = 0;
virtual unsigned int getMaxRowSize() = 0;
virtual unsigned int getMaxSchemaNameLength() = 0;
virtual unsigned int getMaxStatementLength() = 0;
virtual unsigned int getMaxStatements() = 0;
virtual unsigned int getMaxTableNameLength() = 0;
virtual unsigned int getMaxTablesInSelect() = 0;
virtual unsigned int getMaxUserNameLength() = 0;
virtual const std::string& getNumericFunctions() = 0;
virtual ResultSet * getPrimaryKeys(const std::string& catalog, const std::string& schema, const std::string& table) = 0;
virtual ResultSet * getProcedures(const std::string& catalog, const std::string& schemaPattern, const std::string& procedureNamePattern) = 0;
virtual const std::string& getProcedureTerm() = 0;
virtual int getResultSetHoldability() = 0;
virtual ResultSet * getSchemas() = 0;
virtual const std::string& getSchemaTerm() = 0;
virtual const std::string& getSearchStringEscape() = 0;
virtual const std::string& getSQLKeywords() = 0;
virtual int getSQLStateType() = 0;
virtual const std::string& getStringFunctions() = 0;
virtual ResultSet * getSuperTables(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern) = 0;
virtual ResultSet * getSuperTypes(const std::string& catalog, const std::string& schemaPattern, const std::string& typeNamePattern) = 0;
virtual const std::string& getSystemFunctions() = 0;
virtual ResultSet * getTablePrivileges(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern) = 0;
virtual ResultSet * getTables(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern, std::list<std::string> &types) = 0;
virtual ResultSet * getTableTypes() = 0;
virtual const std::string& getTimeDateFunctions() = 0;
virtual ResultSet * getTypeInfo() = 0;
virtual ResultSet * getUDTs(const std::string& catalog, const std::string& schemaPattern, const std::string& typeNamePattern, std::list<int> &types) = 0;
virtual std::string getUserName() = 0;
virtual ResultSet * getVersionColumns(const std::string& catalog, const std::string& schema, const std::string& table) = 0;
virtual bool insertsAreDetected(int type) = 0;
virtual bool isCatalogAtStart() = 0;
virtual bool isReadOnly() = 0;
virtual bool nullPlusNonNullIsNull() = 0;
virtual bool nullsAreSortedAtEnd() = 0;
virtual bool nullsAreSortedAtStart() = 0;
virtual bool nullsAreSortedHigh() = 0;
virtual bool nullsAreSortedLow() = 0;
virtual bool othersDeletesAreVisible(int type) = 0;
virtual bool othersInsertsAreVisible(int type) = 0;
virtual bool othersUpdatesAreVisible(int type) = 0;
virtual bool ownDeletesAreVisible(int type) = 0;
virtual bool ownInsertsAreVisible(int type) = 0;
virtual bool ownUpdatesAreVisible(int type) = 0;
virtual bool storesLowerCaseIdentifiers() = 0;
virtual bool storesLowerCaseQuotedIdentifiers() = 0;
virtual bool storesMixedCaseIdentifiers() = 0;
virtual bool storesMixedCaseQuotedIdentifiers() = 0;
virtual bool storesUpperCaseIdentifiers() = 0;
virtual bool storesUpperCaseQuotedIdentifiers() = 0;
virtual bool supportsAlterTableWithAddColumn() = 0;
virtual bool supportsAlterTableWithDropColumn() = 0;
virtual bool supportsANSI92EntryLevelSQL() = 0;
virtual bool supportsANSI92FullSQL() = 0;
virtual bool supportsANSI92IntermediateSQL() = 0;
virtual bool supportsBatchUpdates() = 0;
virtual bool supportsCatalogsInDataManipulation() = 0;
virtual bool supportsCatalogsInIndexDefinitions() = 0;
virtual bool supportsCatalogsInPrivilegeDefinitions() = 0;
virtual bool supportsCatalogsInProcedureCalls() = 0;
virtual bool supportsCatalogsInTableDefinitions() = 0;
virtual bool supportsColumnAliasing() = 0;
virtual bool supportsConvert() = 0;
virtual bool supportsConvert(int fromType, int toType) = 0;
virtual bool supportsCoreSQLGrammar() = 0;
virtual bool supportsCorrelatedSubqueries() = 0;
virtual bool supportsDataDefinitionAndDataManipulationTransactions() = 0;
virtual bool supportsDataManipulationTransactionsOnly() = 0;
virtual bool supportsDifferentTableCorrelationNames() = 0;
virtual bool supportsExpressionsInOrderBy() = 0;
virtual bool supportsExtendedSQLGrammar() = 0;
virtual bool supportsFullOuterJoins() = 0;
virtual bool supportsGetGeneratedKeys() = 0;
virtual bool supportsGroupBy() = 0;
virtual bool supportsGroupByBeyondSelect() = 0;
virtual bool supportsGroupByUnrelated() = 0;
virtual bool supportsLikeEscapeClause() = 0;
virtual bool supportsLimitedOuterJoins() = 0;
virtual bool supportsMinimumSQLGrammar() = 0;
virtual bool supportsMixedCaseIdentifiers() = 0;
virtual bool supportsMixedCaseQuotedIdentifiers() = 0;
virtual bool supportsMultipleOpenResults() = 0;
virtual bool supportsMultipleResultSets() = 0;
virtual bool supportsMultipleTransactions() = 0;
virtual bool supportsNamedParameters() = 0;
virtual bool supportsNonNullableColumns() = 0;
virtual bool supportsOpenCursorsAcrossCommit() = 0;
virtual bool supportsOpenCursorsAcrossRollback() = 0;
virtual bool supportsOpenStatementsAcrossCommit() = 0;
virtual bool supportsOpenStatementsAcrossRollback() = 0;
virtual bool supportsOrderByUnrelated() = 0;
virtual bool supportsOuterJoins() = 0;
virtual bool supportsPositionedDelete() = 0;
virtual bool supportsPositionedUpdate() = 0;
virtual bool supportsResultSetHoldability(int holdability) = 0;
virtual bool supportsResultSetType(int type) = 0;
virtual bool supportsSavepoints() = 0;
virtual bool supportsSchemasInDataManipulation() = 0;
virtual bool supportsSchemasInIndexDefinitions() = 0;
virtual bool supportsSchemasInPrivilegeDefinitions() = 0;
virtual bool supportsSchemasInProcedureCalls() = 0;
virtual bool supportsSchemasInTableDefinitions() = 0;
virtual bool supportsSelectForUpdate() = 0;
virtual bool supportsStatementPooling() = 0;
virtual bool supportsStoredProcedures() = 0;
virtual bool supportsSubqueriesInComparisons() = 0;
virtual bool supportsSubqueriesInExists() = 0;
virtual bool supportsSubqueriesInIns() = 0;
virtual bool supportsSubqueriesInQuantifieds() = 0;
virtual bool supportsTableCorrelationNames() = 0;
virtual bool supportsTransactionIsolationLevel(int level) = 0;
virtual bool supportsTransactions() = 0;
virtual bool supportsTypeConversion() = 0; /* SDBC */
virtual bool supportsUnion() = 0;
virtual bool supportsUnionAll() = 0;
virtual bool updatesAreDetected(int type) = 0;
virtual bool usesLocalFilePerTable() = 0;
virtual bool usesLocalFiles() = 0;
virtual ResultSet *getSchemata(const std::string& catalogName = "") = 0;
virtual ResultSet *getSchemaObjects(const std::string& catalogName = "",
const std::string& schemaName = "",
const std::string& objectType = "") = 0;
virtual ResultSet *getSchemaObjectTypes() = 0;
};
} /* namespace sql */
#endif /* _SQL_METADATA_H_ */

View file

@ -0,0 +1,46 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_PARAMETER_METADATA_H_
#define _SQL_PARAMETER_METADATA_H_
#include <string>
namespace sql
{
class ParameterMetaData
{
public:
enum
{
parameterModeIn,
parameterModeInOut,
parameterModeOut,
parameterModeUnknown
};
enum
{
parameterNoNulls,
parameterNullable,
parameterNullableUnknown
};
virtual int getParameterCount() = 0;
protected:
virtual ~ParameterMetaData() {}
};
} /* namespace sql */
#endif /* _SQL_PARAMETER_METADATA_H_ */

View file

@ -0,0 +1,76 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_PREPARED_STATEMENT_H_
#define _SQL_PREPARED_STATEMENT_H_
#include <iostream>
#include "statement.h"
namespace sql
{
class Connection;
class ResultSet;
class ResultSetMetaData;
class ParameterMetaData;
class PreparedStatement : public Statement
{
public:
virtual ~PreparedStatement() {}
virtual void clearParameters() = 0;
virtual bool execute(const std::string& sql) = 0;
virtual bool execute() = 0;
virtual ResultSet *executeQuery(const std::string& sql) = 0;
virtual ResultSet *executeQuery() = 0;
virtual int executeUpdate(const std::string& sql) = 0;
virtual int executeUpdate() = 0;
virtual ResultSetMetaData * getMetaData() = 0;
virtual ParameterMetaData * getParameterMetaData() = 0;
virtual void setBigInt(unsigned int parameterIndex, const std::string& value) = 0;
virtual void setBlob(unsigned int parameterIndex, std::istream * blob) = 0;
virtual void setBoolean(unsigned int parameterIndex, bool value) = 0;
virtual void setDateTime(unsigned int parameterIndex, const std::string& value) = 0;
virtual void setDouble(unsigned int parameterIndex, double value) = 0;
virtual void setInt(unsigned int parameterIndex, int32_t value) = 0;
virtual void setUInt(unsigned int parameterIndex, uint32_t value) = 0;
virtual void setInt64(unsigned int parameterIndex, int64_t value) = 0;
virtual void setUInt64(unsigned int parameterIndex, uint64_t value) = 0;
virtual void setNull(unsigned int parameterIndex, int sqlType) = 0;
virtual void setString(unsigned int parameterIndex, const std::string& value) = 0;
virtual PreparedStatement * setResultSetType(sql::ResultSet::enum_type type) = 0;
};
} /* namespace sql */
#endif /* _SQL_PREPARED_STATEMENT_H_ */

View file

@ -0,0 +1,135 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_RESULTSET_H_
#define _SQL_RESULTSET_H_
#include "config.h"
#include <list>
#include <string>
#include <map>
#include <iostream>
#include "resultset_metadata.h"
namespace sql
{
class Statement;
class RowID
{
public:
virtual ~RowID() {}
};
class ResultSet
{
public:
enum
{
CLOSE_CURSORS_AT_COMMIT,
HOLD_CURSORS_OVER_COMMIT
};
enum
{
CONCUR_READ_ONLY,
CONCUR_UPDATABLE
};
enum
{
FETCH_FORWARD,
FETCH_REVERSE,
FETCH_UNKNOWN
};
typedef enum
{
TYPE_FORWARD_ONLY,
TYPE_SCROLL_INSENSITIVE,
TYPE_SCROLL_SENSITIVE
} enum_type;
virtual ~ResultSet() {}
virtual bool absolute(int row) = 0;
virtual void afterLast() = 0;
virtual void beforeFirst() = 0;
virtual void close() = 0;
virtual uint32_t findColumn(const std::string& columnLabel) const = 0;
virtual bool first() = 0;
virtual std::istream * getBlob(uint32_t columnIndex) const = 0;
virtual std::istream * getBlob(const std::string& columnLabel) const = 0;
virtual bool getBoolean(uint32_t columnIndex) const = 0;
virtual bool getBoolean(const std::string& columnLabel) const = 0;
virtual long double getDouble(uint32_t columnIndex) const = 0;
virtual long double getDouble(const std::string& columnLabel) const = 0;
virtual int32_t getInt(uint32_t columnIndex) const = 0;
virtual int32_t getInt(const std::string& columnLabel) const = 0;
virtual uint32_t getUInt(uint32_t columnIndex) const = 0;
virtual uint32_t getUInt(const std::string& columnLabel) const = 0;
virtual int64_t getInt64(uint32_t columnIndex) const = 0;
virtual int64_t getInt64(const std::string& columnLabel) const = 0;
virtual uint64_t getUInt64(uint32_t columnIndex) const = 0;
virtual uint64_t getUInt64(const std::string& columnLabel) const = 0;
virtual ResultSetMetaData * getMetaData() const = 0;
virtual size_t getRow() const = 0;
virtual const Statement * getStatement() const = 0;
virtual std::string getString(uint32_t columnIndex) const = 0;
virtual std::string getString(const std::string& columnLabel) const = 0;
virtual enum_type getType() const = 0;
virtual bool isAfterLast() const = 0;
virtual bool isBeforeFirst() const = 0;
virtual bool isClosed() const = 0;
virtual bool isFirst() const = 0;
virtual bool isLast() const = 0;
virtual bool isNull(uint32_t columnIndex) const = 0;
virtual bool isNull(const std::string& columnLabel) const = 0;
virtual bool last() = 0;
virtual bool next() = 0;
virtual bool previous() = 0;
virtual bool relative(int rows) = 0;
virtual size_t rowsCount() const = 0;
virtual bool wasNull() const = 0;
};
} /* namespace sql */
#endif /* _SQL_RESULTSET_H_ */

View file

@ -0,0 +1,80 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_RESULTSET_METADATA_H_
#define _SQL_RESULTSET_METADATA_H_
#include <string>
#include "datatype.h"
namespace sql
{
class ResultSetMetaData
{
public:
enum
{
columnNoNulls,
columnNullable,
columnNullableUnknown
};
virtual std::string getCatalogName(unsigned int column) = 0;
virtual unsigned int getColumnCount() = 0;
virtual unsigned int getColumnDisplaySize(unsigned int column) = 0;
virtual std::string getColumnLabel(unsigned int column) = 0;
virtual std::string getColumnName(unsigned int column) = 0;
virtual int getColumnType(unsigned int column) = 0;
virtual std::string getColumnTypeName(unsigned int column) = 0;
virtual unsigned int getPrecision(unsigned int column) = 0;
virtual unsigned int getScale(unsigned int column) = 0;
virtual std::string getSchemaName(unsigned int column) = 0;
virtual std::string getTableName(unsigned int column) = 0;
virtual bool isAutoIncrement(unsigned int column) = 0;
virtual bool isCaseSensitive(unsigned int column) = 0;
virtual bool isCurrency(unsigned int column) = 0;
virtual bool isDefinitelyWritable(unsigned int column) = 0;
virtual int isNullable(unsigned int column) = 0;
virtual bool isReadOnly(unsigned int column) = 0;
virtual bool isSearchable(unsigned int column) = 0;
virtual bool isSigned(unsigned int column) = 0;
virtual bool isWritable(unsigned int column) = 0;
virtual bool isZerofill(unsigned int column) = 0;
protected:
virtual ~ResultSetMetaData() {}
};
} /* namespace sql */
#endif /* _SQL_RESULTSET_METADATA_H_ */

View file

@ -0,0 +1,60 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_STATEMENT_H_
#define _SQL_STATEMENT_H_
#include "config.h"
#include "resultset.h"
#include <string>
namespace sql
{
class ResultSet;
class Connection;
class SQLWarning;
class Statement
{
public:
virtual ~Statement() {};
virtual Connection * getConnection() = 0;
virtual void clearWarnings() = 0;
virtual void close() = 0;
virtual bool execute(const std::string& sql) = 0;
virtual ResultSet * executeQuery(const std::string& sql) = 0;
virtual int executeUpdate(const std::string& sql) = 0;
virtual bool getMoreResults() = 0;
virtual ResultSet * getResultSet() = 0;
virtual sql::ResultSet::enum_type getResultSetType() = 0;
virtual uint64_t getUpdateCount() = 0;
virtual const SQLWarning * getWarnings() = 0;
virtual Statement * setResultSetType(sql::ResultSet::enum_type type) = 0;
};
} /* namespace sql */
#endif /* _SQL_STATEMENT_H_ */

View file

@ -0,0 +1,99 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _SQL_WARNING_H_
#define _SQL_WARNING_H_
#include <stdexcept>
#include <string>
#include <memory>
namespace sql
{
#ifdef _WIN32
#pragma warning (disable : 4290)
//warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
class SQLWarning
{
protected:
const std::string sql_state;
const int errNo;
SQLWarning * next;
const std::string descr;
public:
SQLWarning(const std::string& reason, const std::string& SQLState, int vendorCode) :sql_state(SQLState), errNo(vendorCode),descr(reason)
{
}
SQLWarning(const std::string& reason, const std::string& SQLState) :sql_state (SQLState), errNo(0), descr(reason)
{
}
SQLWarning(const std::string& reason) : sql_state ("HY000"), errNo(0), descr(reason)
{
}
SQLWarning() : sql_state ("HY000"), errNo(0) {}
const std::string & getMessage() const
{
return descr;
}
const std::string & getSQLState() const
{
return sql_state;
}
int getErrorCode() const
{
return errNo;
}
const SQLWarning * getNextWarning() const
{
return next;
}
void setNextWarning(SQLWarning * _next)
{
next = _next;
}
virtual ~SQLWarning() throw () {};
protected:
SQLWarning(const SQLWarning& e) : sql_state(e.sql_state), errNo(e.errNo), next(e.next), descr(e.descr) {}
virtual SQLWarning * copy()
{
return new SQLWarning(*this);
}
private:
const SQLWarning & operator = (const SQLWarning & rhs);
};
} /* namespace sql */
#endif /* _SQL_WARNING_H_ */

View file

@ -0,0 +1,133 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _MYSQL_CONNECTION_H_
#define _MYSQL_CONNECTION_H_
#include <cppconn/connection.h>
struct st_mysql;
namespace sql
{
namespace mysql
{
class MySQL_Savepoint : public sql::Savepoint
{
std::string name;
public:
MySQL_Savepoint(const std::string &savepoint);
virtual ~MySQL_Savepoint() {}
int getSavepointId();
std::string getSavepointName();
private:
/* Prevent use of these */
MySQL_Savepoint(const MySQL_Savepoint &);
void operator=(MySQL_Savepoint &);
};
class MySQL_DebugLogger;
class MySQL_ConnectionData; /* PIMPL */
class CPPCONN_PUBLIC_FUNC MySQL_Connection : public sql::Connection
{
public:
MySQL_Connection(const std::string& hostName, const std::string& userName, const std::string& password);
MySQL_Connection(std::map< std::string, sql::ConnectPropertyVal > & options);
virtual ~MySQL_Connection();
struct ::st_mysql * getMySQLHandle();
void clearWarnings();
void close();
void commit();
sql::Statement * createStatement();
bool getAutoCommit();
std::string getCatalog();
std::string getSchema();
std::string getClientInfo();
void getClientOption(const std::string & optionName, void * optionValue);
sql::DatabaseMetaData * getMetaData();
enum_transaction_isolation getTransactionIsolation();
const SQLWarning * getWarnings();
bool isClosed();
std::string nativeSQL(const std::string& sql);
sql::PreparedStatement * prepareStatement(const std::string& sql);
void releaseSavepoint(Savepoint * savepoint) ;
void rollback();
void rollback(Savepoint * savepoint);
void setAutoCommit(bool autoCommit);
void setCatalog(const std::string& catalog);
void setSchema(const std::string& catalog);
sql::Connection * setClientOption(const std::string & optionName, const void * optionValue);
sql::Savepoint * setSavepoint(const std::string& name);
void setTransactionIsolation(enum_transaction_isolation level);
std::string getSessionVariable(const std::string & varname);
void setSessionVariable(const std::string & varname, const std::string & value);
protected:
void checkClosed();
void init(std::map<std::string, sql::ConnectPropertyVal> & properties);
MySQL_ConnectionData * intern; /* pimpl */
private:
/* Prevent use of these */
MySQL_Connection(const MySQL_Connection &);
void operator=(MySQL_Connection &);
};
} /* namespace mysql */
} /* namespace sql */
#endif // _MYSQL_CONNECTION_H_
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/

View file

@ -0,0 +1,68 @@
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
#ifndef _MYSQL_DRIVER_H_
#define _MYSQL_DRIVER_H_
#include <cppconn/driver.h>
namespace sql
{
namespace mysql
{
class Connection;
class ConnectProperty;
class CPPCONN_PUBLIC_FUNC MySQL_Driver : public sql::Driver
{
public:
MySQL_Driver(); /* DON'T CALL THIS, USE Instance() */
virtual ~MySQL_Driver();/* DON'T CALL THIS, MEMORY WILL BE AUTOMAGICALLY CLEANED */
static MySQL_Driver * Instance();
sql::Connection * connect(const std::string& hostName,
const std::string& userName,
const std::string& password);
sql::Connection * connect(std::map<std::string, sql::ConnectPropertyVal> & options);
int getMajorVersion();
int getMinorVersion();
int getPatchVersion();
const std::string & getName();
private:
/* Prevent use of these */
MySQL_Driver(const MySQL_Driver &);
void operator=(MySQL_Driver &);
};
CPPCONN_PUBLIC_FUNC MySQL_Driver *get_mysql_driver_instance();
} /* namespace mysql */
} /* namespace sql */
#endif // _MYSQL_DRIVER_H_
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.