package cn.sasa.demo1; import java.sql.Connection; import java.sql.SQLException; import java.util.List; import java.util.Map; import org.apache.commons.dbutils.QueryRunner; import org.apache.common... Read More
posted @ 2019-01-18 11:24 SasaL Views(563) Comments(0) Diggs(0) Edit
dbutils是apache封装了JDBC的工具类,比mysql-connector更方便些 下载地址:http://commons.apache.org/proper/commons-dbutils/download_dbutils.cgi database.properties: Read More
posted @ 2019-01-18 11:20 SasaL Views(627) Comments(0) Diggs(0) Edit
1、在src目录下创建文件 database.properties 2、创建读取配置文件信息的类DBProperties.java 3、JDBC的工具类 4、测试类 Read More
posted @ 2019-01-09 13:57 SasaL Views(532) Comments(0) Diggs(0) Edit
package cn.sasa.demo4; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; public class TestJDBCUti... Read More
posted @ 2019-01-08 17:43 SasaL Views(161) Comments(0) Diggs(0) Edit
package cn.sasa.demo3; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Scanner; public class JDBCDemo3 {... Read More
posted @ 2019-01-07 17:19 SasaL Views(244) Comments(0) Diggs(0) Edit
package cn.sasa.demo2; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statem... Read More
posted @ 2019-01-07 15:13 SasaL Views(1007) Comments(0) Diggs(0) Edit
package cn.sasa.demo1; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /**导入jar包 : https://dev.mysql... Read More
posted @ 2019-01-07 14:01 SasaL Views(194) Comments(0) Diggs(0) Edit
package cn.sasa.demo5; public class Resources { private String name; private boolean gender; //标记 public boolean flag; //如果falg==true ,赋值完成 //如果flag==false 取值完成 ... Read More
posted @ 2019-01-04 11:35 SasaL Views(172) Comments(0) Diggs(0) Edit
package cn.sasa.demo4; public class ThreadDemo { public static void main(String[] args){ DeadLockRunnable dead = new DeadLockRunnable(); Thread t0 = new Thread(dead); T... Read More
posted @ 2018-12-29 14:38 SasaL Views(144) Comments(0) Diggs(0) Edit
package cn.sasa.demo3; import java.util.concurrent.ExecutionException; public class ThreadDemo { public static void main(String[] args) throws InterruptedException, ExecutionException { ... Read More
posted @ 2018-12-29 10:23 SasaL Views(290) Comments(0) Diggs(0) Edit