Home > Database > Mysql Tutorial > java-MyEclipse执行成功,但mysql没有数据。

java-MyEclipse执行成功,但mysql没有数据。

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 09:43:52
Original
1751 people have browsed it

mysqljava数据库没数据数据库连接

<code>    Class.forName("com.mysql.jdbc.Driver");        ct=DriverManager.getConnection("jdbc:mysql://localhost:3306/test1","root","wenhao");        sm=ct.createStatement();        rs=sm.executeQuery("select *from test");        try {        ps=ct.prepareStatement("insert test values(14,'aaa')");        System.out.print("插入成功");        } catch (Exception e) {            // TODO Auto-generated catch block            System.out.print("插入失败");        }</code>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template