返回列表 发帖

请问如何在eclipse中连接mysql

如题~~~~

建议你问的详细些~~

不然其他人怎么帮你?

你做到那一步了?Eclipse是否正确安装了?程序中如何设定的?

你这样问,谁都会一头雾水的~
~助人乃快乐之本~

TOP

eclipse安装都没问题,只是不知道在程序中怎么连接mysql,请大家指点!

TOP

请问你所说的“程序中怎么连接MYSQL”是不是JAVA程序连接MYSQL啊?

如果是的话那就需要用JDBC连接包


文件版本:mysql-connector-java-3.0.16-ga.zip
下载地址:http://dev.mysql.com/downloads/index.html

TOP

再次请教,如何使用啊

TOP

下个JDBC驱动,然后解压里面有一个PDF格式的文件,看了就会了,全英文的哦,你问得太那个了,没办法帮你!

TOP

try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?user=monty&password=greatsqldb");

            // Do something with the Connection

           ....
        } catch (SQLException ex) {
            // handle any errors
            System.out.println("SQLException: " + ex.getMessage());
            System.out.println("SQLState: " + ex.getSQLState());
            System.out.println("VendorError: " + ex.getErrorCode());
        }

TOP

返回列表