MM.MYSQL is a type 4 (ie, pure Java) that conforms to the JDBC 2 specification MySQL JDBC driver. The current version is 2.0 pre 5 (Beta)
You can download the latest drivers from http://www.worldserver.com/mm.mysql/
This article is just a brief description of MM.MYSQL installation and use
Install 1, download mm.mysql 2, extract to a drive, such as C: 3, modify ClassPath, add mm.mysql path, such as your original classpath may be:.; C: JDK1.2.2lib ols.jar; c : jdk1.2.2libdt.jar; may be.; C: jdk1.2.2lib ools.jar; c: jdk1.2.2libdt.jar; c: mm.mysql.jdbc-2.0pre5; programming 1, use DriverManager registration MM.MYSQL MM.MYSQL's class name is org.gjt.mm.mysql.driver, must be written as class.forname ("org.gjt.mm.mysql.driver). NewInStance (); 2, JDBC URL parameter Description URL format: JDBC: mysql: // [hostname] [: port] / dbname [? Param1 = value1] [m2 = value2] ... Parameter name Value default USER Database Username No password database User password AutoreConnect When the database connection is lost, it is automatically connected. True / false false maxReconnects If autoreconnect is true, this parameter is re-test number, the default is 3 times 3 INITIALTIMEOUT If AutoreConnect is True, this parameter is a replication waiting second Number 2 MaxRows Set the number of rows returned when queries, 0 means all 0 UseUNICODE uses unicode output, true / false false characterencoding If useunicode, this parameter makes an Encoding type, it is recommended to use Useunicate, CharacterenCoding, using the 8859_1, CHARACTERENCODING, can solve the database output Time Chinese issues such as: jdbc: mysql: // localhost / test? User = root & useunicode = true; characterencoding = 8859_1 actual example, raising a simple example This JSP example uses a library, the library has only one table (address book) Create Database AddressBook Use Addressbook Create Table AddressBook (ID INT A uto_increment primary key, name varchar (30), address varchar (255), phone varchar (20)); inserting a recording insert into addressbook (name, address, phone) values (jjx, zhejiang yuyao, 0574-2222222); jsp Code: The directory used in the code using absolute, resultSet.Type_scrool_sensitive, etc. is to test whether mm.mysql meets JDBC 2.0 specification <% @ page import = "java.sql. *"%> <% Out.println ("address book! "); Try {class.forname (" org.gjt.mm.mysql.driver). NewInstance ();} catch (exception e) {Out.println ("Unable to load driver.");} Try {Connection C = drivermanager.getConnection ("JDBC: mysql: // localhost / addressbook? User = root & password = jjx &