随笔分类 - JDBC
摘要:点击查看代码 public class TestQuery { public static void main(String[] args) { // 1.找驱动 try { Class.forName("com.mysql.cj.jdbc.Driver"); } catch (ClassNotFo
阅读全文
摘要:一、创建properties.properties文件连接好数据库 点击查看代码 driver=com.mysql.cj.jdbc.Driver url=jdbc:mysql://localhost:3306/demo01 username=root password=root zero=0 二、创
阅读全文
摘要:setObject setObject就是给JDBC的SQL语句的占位符赋值的,即是下面的“?” 预编译的SQL:参数使用?作为占位符 注意:sql的参数使用?作为占位符。 如: select * from user where username = ? and password = ?; 1 获取
阅读全文

浙公网安备 33010602011771号