数据库工具类
DataBaseUtil.properties ##choose which database datatype=mysql ##oracle oracleDriver=oracle.jdbc.driver.OracleDriver oracleUrl=jdbc:oracle:thin:@127.0.0.1:1521:xe oracleUser=scott oraclePassword=tiger ##mysql mysqlDriver=com.mysql.jdbc.Driver mysqlUrl=jdbc:mysql://127.0.0.1:3306/bjsxt20151014 mysqlUser=root mysqlPassword=123456 DBUtils.java import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import java.util.Properties; public class DBUtils { //获取数据库配置信息 private static Properties properties = new Properties(); //定义JDBC需要的参数 private static String datatype = null; private static String driver = null; private static String url = null; private static String user = null; private static String password = null; static { //可以保证只加载一次,而且调用的时候肯定已经加载完成 try { //加载配置文件 properties....