随笔分类 -  jdbc

摘要:public static void main(String[] args) { try { Properties p =new Properties(); p.load(Thread.currentThread().getContextClassLoader().getResourceAsStre 阅读全文
posted @ 2021-03-06 15:50 谷先生 阅读(178) 评论(0) 推荐(0)
摘要:public class druid { public static void main(String[] args) { Map<String, String> map = new HashMap<>(); map.put("url","jdbc:mysql:/db1"); map.put("us 阅读全文
posted @ 2021-03-03 21:31 谷先生 阅读(305) 评论(0) 推荐(0)
摘要:public class dbutilstext { public static void main(String[] args) { try { Connection c =DriverManager.getConnection("jdbc:mysql:/db1?user=aa"); // Sys 阅读全文
posted @ 2021-03-03 20:01 谷先生 阅读(95) 评论(0) 推荐(0)
摘要:public class PreparedStatmentDemo { public static void main(String[] args) { try { //var:定义变量 var c =new DbUtil().getConn(); PreparedStatement ps = c. 阅读全文
posted @ 2021-03-01 18:36 谷先生 阅读(217) 评论(0) 推荐(0)
摘要:链接数据库 public static void main(String[] args) { //简约方式 try { Connection conn = DriverManager.getConnection("jdbc:mysql:/mysql?user=aa"); Statement st = 阅读全文
posted @ 2021-03-01 12:33 谷先生 阅读(245) 评论(0) 推荐(0)