1. MySQL Connector/J
________________________________________________________
MySQL provides connectivity for client applications developed
in the Java programming language via a JDBC driver, which is
called MySQL Connector/J.
MySQL Connector/J is a JDBC-3.0 Type 4 driver, which means
that is pure Java, implements version 3.0 of the JDBC
specification, and communicates directly with the MySQL
server using the MySQL protocol.
Although JDBC is useful by itself, we would hope that if you
are not familiar with JDBC that after reading the first few
sections of this manual, that you would avoid using naked
JDBC for all but the most trivial problems and consider using
one of the popular persistence frameworks such as Hibernate
(http://www.hibernate.org/), Spring's JDBC templates
(http://www.springframework.org/) or Ibatis SQL Maps
(http://ibatis.apache.org/) to do the majority of repetitive
work and heavier lifting that is sometimes required with
JDBC.
This section is not designed to be a complete JDBC tutorial.
If you need more information about using JDBC you might be
interested in the following online tutorials that are more
in-depth than the information presented here:
* JDBC Basics
(http://java.sun.com/docs/books/tutorial/jdbc/basics/inde
x.html) --- A tutorial from Sun covering beginner topics
in JDBC
* JDBC Short Course
(http://java.sun.com/developer/onlineTraining/Database/JD
BCShortCourse/index.html) --- A more in-depth tutorial
from Sun and JGuru
Key topics:
* For help with connection strings, connection options
setting up your connection through JDBC, see Section
Section, "Driver/Datasource Class Names, URL Syntax and
Configuration Properties for Connector/J."
* For tips on using Connector/J and JDBC with generic J2EE
toolkits, see Section Section, "Using Connector/J with
J2EE and Other Java Frameworks."
* Developers using the Tomcat server platform, see Section
Section, "Using Connector/J with Tomcat."
* Developers using JBoss, see Section Section, "Using
Connector/J with JBoss."
* Developers using Spring, see Section Section, "Using
Connector/J with Spring."
MySQL Enterprise MySQL Enterprise subscribers will find more
information about using JDBC with MySQL in the Knowledge Base
articles about JDBC
(https://kb.mysql.com/search.php?cat=search&category=10).
Access to the MySQL Knowledge Base collection of articles is
one of the advantages of subscribing to MySQL Enterprise. For
more information see
http://www.mysql.com/products/enterprise/advisors.html.
1.1. Connector/J Versions
There are currently four versions of MySQL Connector/J
available:
* Connector/J 5.1 is current in alpha status. It provides
compatibility with all the functionality of MySQL,
including 4.1, 5.0, 5.1 and the 6.0 alpha release
featuring the new Falcon storage engine. Connector/J 5.1
provides ease of development features, including
auto-registration with the Driver Manager, standardized
validity checks, categorized SQLExceptions, support for
the JDBC-4.0 XML processing, per connection client
information, NCHAR, NVARCHAR and NCLOB types. This
release also includes all bug fixes up to and including
Connector/J 5.0.6.
* Connector/J 5.0 provides support for all the
functionality offered by Connector/J 3.1 and includes
distributed transaction (XA) support.
* Connector/J 3.1 was designed for connectivity to MySQL
4.1 and MySQL 5.0 servers and provides support for all
the functionality in MySQL 5.0 except distributed
transaction (XA) support.
* Connector/J 3.0 provides core functionality and was
designed with connectivity to MySQL 3.x or MySQL 4.1
servers, although it will provide basic compatibility
with later versions of MySQL. Connector/J 3.0 does not
support server-side prepared statements, and does not
support any of the features in versions of MySQL later
than 4.1.
The current recommended version for Connector/J is 5.0. This
guide covers all three connector versions, with specific
notes given where a setting applies to a specific option.
1.1.1. Java Versions Supported
MySQL Connector/J supports Java-2 JVMs, including:
* JDK 1.2.x (only for Connector/J 3.1.x or earlier)
* JDK 1.3.x
* JDK 1.4.x
* JDK 1.5.x
If you are building Connector/J from source using the source
distribution (see Section Section, "Installing from the
Development Source Tree") then you must use JDK 1.4.x or
newer to compiler the Connector package.
MySQL Connector/J does not support JDK-1.1.x or JDK-1.0.x.
Because of the implementation of java.sql.Savepoint,
Connector/J 3.1.0 and newer will not run on JDKs older than
1.4 unless the class verifier is turned off (by setting the
-Xverify:none option to the Java runtime). This is because
the class verifier will try to load the class definition for
java.sql.Savepoint even though it is not accessed by the
driver unless you actually use savepoint functionality.
Caching functionality provided by Connector/J 3.1.0 or newer
is also not available on JVMs older than 1.4.x, as it relies
on java.util.LinkedHashMap which was first available in
JDK-1.4.0.
1.2. Connector/J Installation
You can install the Connector/J package using two methods,
using either the binary or source distribution. The binary
distribution provides the easiest methods for installation;
the source distribution enables you to customize your
installation further. With either solution, you must manually
add the Connector/J location to your Java CLASSPATH.
1.2.1. Installing Connector/J from a Binary Distribution
The easiest method of installation is to use the binary
distribution of the Connector/J package. The binary
distribution is available either as a Tar/Gzip or Zip file
which you must extract to a suitable location and then
optionally make the information about the package available
by changing your CLASSPATH (see Section Section, "Installing
the Driver and Configuring the CLASSPATH").
MySQL Connector/J is distributed as a .zip or .tar.gz archive
containing the sources, the class files, and the JAR archive
named mysql-connector-java-[version]-bin.jar, and starting
with Connector/J 3.1.8 a debug build of the driver in a file
named mysql-connector-java-[version]-bin-g.jar.
Starting with Connector/J 3.1.9, the .class files that
constitute the JAR files are only included as part of the
driver JAR file.
You should not use the debug build of the driver unless
instructed to do so when reporting a problem or a bug to
MySQL AB, as it is not designed to be run in production
environments, and will have adverse performance impact when
used. The debug binary also depends on the Aspect/J runtime
library, which is located in the src/lib/aspectjrt.jar file
that comes with the Connector/J distribution.
You will need to use the appropriate graphical or
command-line utility to extract the distribution (for
example, WinZip for the .zip archive, and tar for the .tar.gz
archive). Because there are potentially long filenames in the
distribution, we use the GNU tar archive format. You will
need to use GNU tar (or an application that understands the
GNU tar archive format) to unpack the .tar.gz variant of the
distribution.
1.2.2. Installing the Driver and Configuring the CLASSPATH
Once you have extracted the distribution archive, you can
install th
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
mysql-connector-java-5.1.5 (247个子文件)
Tracer.aj 7KB
c3p0-LICENSE 26KB
CHANGES 151KB
COPYING 19KB
EXCEPTIONS-CONNECTOR-J 5KB
tb2-data.txt.gz 232KB
connector-j.html 233KB
LICENSE-AspectJ.html 16KB
aspectjtools.jar 5.22MB
mysql-connector-java-5.1.5-bin.jar 661KB
c3p0-0.9.1-pre6.jar 519KB
log4j-1.2.9.jar 344KB
ant-contrib.jar 190KB
junit.jar 118KB
jboss-common-jdbc-wrapper.jar 49KB
commons-logging.jar 37KB
aspectjrt.jar 34KB
jta-spec1_0_1.jar 8KB
jdbc2_0-stdext.jar 7KB
DatabaseMetaData.java 245KB
ResultSetImpl.java 237KB
ConnectionImpl.java 151KB
MysqlIO.java 146KB
ConnectionPropertiesImpl.java 142KB
PreparedStatement.java 139KB
ResultSetRegressionTest.java 133KB
StatementRegressionTest.java 115KB
UpdatableResultSet.java 77KB
StatementImpl.java 71KB
CallableStatementWrapper.java 70KB
ServerPreparedStatement.java 69KB
CallableStatement.java 65KB
ConnectionWrapper.java 62KB
ConnectionRegressionTest.java 61KB
MetaDataRegressionTest.java 60KB
StatementsTest.java 55KB
ConnectionTest.java 54KB
TimeUtil.java 51KB
SQLError.java 47KB
DatabaseMetaDataUsingInfoSchema.java 46KB
StringUtils.java 42KB
ResultSetRow.java 41KB
CharsetMapping.java 40KB
CallableStatementRegressionTest.java 37KB
PreparedStatementWrapper.java 33KB
ConnectionProperties.java 33KB
JDBC4CallableStatementWrapper.java 31KB
MetadataTest.java 29KB
StringRegressionTest.java 28KB
JDBC4MysqlSQLXML.java 26KB
Field.java 26KB
StatementsTest.java 26KB
NonRegisteringDriver.java 22KB
ResultSetMetaData.java 22KB
StatementWrapper.java 20KB
MysqlXAConnection.java 20KB
EscapeProcessor.java 20KB
BufferRow.java 20KB
JDBC4UpdatableResultSet.java 20KB
MysqlErrorNumbers.java 17KB
BlobFromLocator.java 17KB
BaseTestCase.java 17KB
JDBC4ResultSet.java 17KB
CharsetTests.java 16KB
MysqlDefs.java 16KB
Buffer.java 16KB
JDBC4PreparedStatementWrapper.java 16KB
CallableStatementTest.java 15KB
Util.java 15KB
ReplicationConnection.java 15KB
MicroPerformanceRegressionTest.java 14KB
LoadBalancingConnectionProxy.java 14KB
DateTest.java 14KB
DataSourceRegressionTest.java 14KB
XATest.java 13KB
ProfilerEvent.java 12KB
PooledConnectionRegressionTest.java 12KB
Connection.java 12KB
Blob.java 12KB
RowDataCursor.java 11KB
StandardSocketFactory.java 11KB
RowDataDynamic.java 11KB
LoadStorePerfTest.java 11KB
BlobRegressionTest.java 11KB
JDBC4ConnectionWrapper.java 10KB
MysqlDataSource.java 9KB
UpdatabilityTest.java 9KB
JDBC4Connection.java 9KB
JDBC4DatabaseMetaData.java 9KB
NumbersRegressionTest.java 9KB
Security.java 9KB
ServerController.java 9KB
ExportControlled.java 9KB
SingleByteCharsetConverter.java 8KB
JDBC4CallableStatement.java 8KB
CompressedInputStream.java 8KB
Clob.java 8KB
RetrievalPerfTest.java 8KB
ByteArrayRow.java 8KB
ResultSetTest.java 8KB
共 247 条
- 1
- 2
- 3
资源评论
Maojm
- 粉丝: 16
- 资源: 27
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功