下载的mysql驱动压缩包里面有readme,自己查查

解决方案 »

  1.   

    帮你贴出来得了:
    USAGE AND INSTALLATIONMySQL Connector/J  is distributed as a .jar archive containing the sources 
    and class files as well as a class-file only "binary" .jar archive 
    named "mysql-connector-j-2.0.13-bin.jar".You will need to use the "jar" command-line utility that comes with your JDK 
    to un-archive the distribution.Once you have un-archived the distribution .jar archive,
    you can install the driver in one of two ways:Either copy the "com" and "org" subdirectories and all of their contents
    to anywhere you like, and put the directory holding the "com" and "org"
    subdirectories in your classpath, or...Put mysql-connector-j-2.0.14-bin.jar in your classpath, either by adding the 
    FULL path to it to your CLASSPATH enviornment variable, or putting it
    in $JAVA_HOME/jre/lib/ext.If you are using a servlet engine or application server, you will have
    to read your vendor's documentation for more information on how to
    configure third-party class libraries, as most application servers
    ignore the CLASSPATH environment variable. If you are developing
    servlets and/or JSPs, and your application server is J2EE-compliant, 
    you should put the driver's .jar file in the WEB-INF/lib subdirectory
    of your webapp, as this is the standard location for third party 
    class libraries in J2EE web applications. You can also use the
    MysqlDataSource, MysqlConnectionPoolDataSource or MysqlXADataSource 
    classes in the com.mysql.jdbc.jdbc2.optional package, if your J2EE 
    application server supports/requires them. MysqlDataSource supports the 
    following parameters (through standard "set" mutators): user
    password
    serverName
    databaseName
    portIf you are going to use the driver with the JDBC DriverManager, you would use
    "com.mysql.jdbc.Driver" as the class that implements java.sql.Driver.You might use this name in a Class.forName() call to load the driver: Class.forName("com.mysql.jdbc.Driver").newInstance();To connect to the database, you need to use a JDBC url with the following 
    format ([xxx] denotes optional url components):  jdbc:mysql://[hostname][:port]/[dbname][?param1=value1][&param2=value2].....URL Parameters (can be passed as properties in 
    DriverManager.getConnection() as well):==============================================================================
    Name                | Use                                       | Default 
    ==============================================================================
    user                | The user to connect as                    | none 
    --------------------+-------------------------------------------+-------------
    password            | The password to use when connecting       | none 
    --------------------+-------------------------------------------+-------------
    autoReconnect       | should the driver attempt to              | false
                        | re-connect if the connection dies?        |
                        | (true/false)                              | 
    --------------------+-------------------------------------------+-------------
    maxReconnects       | if autoReconnect is enabled, how many     | 3
                        | times should the driver attemt to         |
                        | reconnect?                                |
    --------------------+-------------------------------------------+-------------
    initialTimeout      | if autoReconnect is enabled, the          | 2
                        | initial time to wait between              |
                        | re-connect attempts (seconds)             |
    --------------------+-------------------------------------------+-------------
    maxRows             | The maximum number of rows to return      | 0
                        | (0 means return all rows)                 |
    --------------------+-------------------------------------------+-------------
    useUnicode          | should the driver use Unicode character   | false 
                        | encodings when handling                   | 
                        | strings? If not used with                 |
                        | characterEncoding, the driver will        |
                        | attempt to determine the character set    |
                        | in use on the server, and adjust          |
                        | accordingly (true/false)                  | 
    --------------------+-------------------------------------------+-------------
    characterEncoding   | if useUnicode is true, what character     | none
                        | encoding should the driver use when       |
                        | dealing with strings?                     | 
    --------------------+-------------------------------------------+-------------
    relaxAutocommit     | if the version of MySQL the driver        | false
                        | connects to does not support              |
                        | transactions, allow calls to commit,      |
                        | rollback and setAutoCommit? (true/false) |
    --------------------+-------------------------------------------+-------------
    ultraDevHack     | Create PreparedStatements for             | false
                        | prepareCall(), because UltraDev           |
                        | is broken? (true/false)                   |
    --------------------+-------------------------------------------+-------------
    capitalizeTypeNames | Capitalize type names in                  | false
                        | DatabaseMetaData? (usually only           |
                        | usefull when using WebObjects)            |
    --------------------+-------------------------------------------+-------------
    profileSql          | Dump queries and execution/fetch times    | false
                        | to STDERR. Useful for optimizing queries  |
                        | that are auto-generated as in CMP EJBs    |   
                        | (true/false)                              |
    ------------------------------------------------------------------------------

    A simple connection example looks like: Class.forName("com.mysql.jdbc.Driver").newInstance();

    java.sql.Connection conn;

    conn = DriverManager.getConnection(
    "jdbc:mysql://localhost/test?user=blah&password=blah");

    If you need further JDBC tutorial information, please see
    http://www.java.sun.com/products/jdbc/The driver supports batch updates for Statements and PreparedStatements.
    Batch updates will be processed in entirety, if any of the updates raise a
    SQLException, a java.sql.BatchUpdateException will be thrown after all updates
    have been processed, with update count values of '-3' for any statements that
    were not completed (see section 6.1 in the JDBC-2.1 API spec for more details).Various DataSource implementations exist, all under the 
    com.mysql.jdbc.jdbc2.optional package. They are "MysqlDataSource",
    "MysqlConnectionPoolDataSource" and "MysqlXaDataSource". Refer to your 
    application server documentation for information on how to use these classes.
    An example of using the standard DataSource ("MysqlDataSource") can be found
    in the "testsuite" directory.TROUBLESHOOTINGThere are a few issues that seem to be encountered often by users of MySQL Connector/J . 
    This section deals with their symptoms, and their resolutions. If you have
    further issues, see the "SUPPORT" section below.  Issue:   "When I try to connect to the database with MySQL Connector/J , I get the
      following exception:  SQLException: Server configuration denies access to data source
      SQLState: 08001
      VendorError: 0  What's going on? I can connect with the MySQL client."
      

  2.   

    http://www.csdn.net/develop/read_article.asp?id=16101
    去看看吧