Class.forName("org.gjt.mm.mysql.Driver").newInstance(); Stringurl="jdbc:mysql://localhost/myDB?user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1" //myDB为数据库名 Connectionconn=DriverManager.getConnection(url);