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
Latest Articles by Author
-
2025-02-24 12:36:12
-
2025-02-24 12:11:09
-
2025-02-24 12:06:10
-
2025-02-24 12:04:13
-
2025-02-24 12:03:10
-
2025-02-24 12:02:09
-
2025-02-24 12:01:10
-
2025-02-24 12:00:16
-
2025-02-24 11:59:10
-
2025-02-24 11:58:14