Method 1: JDBC Download Address: http://dev.mysql.com/get/downloads/connector-j/mysql-connector-java-3.1.8.tar.gz/from/http: //mirrors.sunsite.dk / mysql / unzip mysql-connector-java-3.1.8.tar.gz, put mysql-connection-java-3.1.8-bin.jar in / usr / loacal / under / usr / loacal / mysql-connectctor -java-3.1.8-bin.jar Add to ClassPath Test Page: <% @ Page ContentType = "Text / HTML; Charset = GB2312"%> <% @ Page Import = "Java.SQL. *"%> < % Connection conn; Statement stmt; ResultSet rs; Class.forName ( "com.mysql.jdbc.Driver") newInstance (); conn = DriverManager.getConnection ( "jdbc:.? mysql: // localhost / mysql user = root & password = & useunicode = true & characterencoding = GB2312 "); stmt = conn.createstatement (); rs = stmt.executeQuery (" Select * from user ");%>