package com.cqust; import com.Mysql.jdbc.Driver; import java.sql.Connection; import java.sql.DriverManager; import java
package com.cqust;
import com.Mysql.jdbc.Driver;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
String sql = "insert into t_user2 (user2_name) values("wangwu"),("lisi")"; int num = statement.executeUpdate(sql); //6.关闭资源 if (statement != null){ statement.close(); } if (connection != null){ connection.close(); } System.out.println(num);
}
}
--结束END--
本文标题: jdbc-使用java连接mysql
本文链接: https://www.lsjlt.com/news/8898.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-04-29
2024-04-29
2024-04-29
2024-04-29
2024-04-29
2024-04-29
2024-04-29
2024-04-29
2024-04-29
2024-04-28
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0