jdbc
来源:互联网 发布:政府网站改版优化文案 编辑:程序博客网 时间:2024/06/13 15:02
1,jdbc为连接数据库的一个方法,
如:Class.forName("org.git.mysql.Driver");
Connection connection=DriverManager.getConnection("mysql:jdbc://127.0.0.1:3306/test","xcl","xcl");
Statement statement=connection.createStatement();
ResultSet resultSet=statement.executeQuery("select * from testuser");
while(resultSet.next()){
resultSet.getString("name");
}
statement.execute("insert into testuser('aa') values('aa')");
statement.executeUpdate("update testuser set aa='1' where id=3");
statement.executeUpdate("delete from testuser");
如:Class.forName("org.git.mysql.Driver");
Connection connection=DriverManager.getConnection("mysql:jdbc://127.0.0.1:3306/test","xcl","xcl");
Statement statement=connection.createStatement();
ResultSet resultSet=statement.executeQuery("select * from testuser");
while(resultSet.next()){
resultSet.getString("name");
}
statement.execute("insert into testuser('aa') values('aa')");
statement.executeUpdate("update testuser set aa='1' where id=3");
statement.executeUpdate("delete from testuser");
阅读全文
0 0
- jdbc
- JDBC
- jdbc
- JDBC
- jdbc
- JDBC
- JDBC
- JDBC
- JDBC
- JDBC
- JDBC
- JDBC
- JDBC
- JDBC
- jdbc
- JDBC
- JDBC
- jdbc
- 数据库关于每科成绩排名
- java中用正则表达式进行判断
- L2-Ansible理论
- eclipse中的web项目,文件夹和文件排列顺序错乱的解决办法
- HashMap认识
- jdbc
- bzoj 1016: [JSOI2008]最小生成树计数
- Windows远程桌面实现之四(在现代浏览器中通过普通页面访问远程桌面)
- jms测试程序_发送和接收
- 百帮忙隐私政策
- jquery easyui tree
- idea快捷键
- Mysql性能测试工具tpcc使用
- python导入第三方模块