包括:写SQL语句的类;生产SQL语句的类;批量运行MySQL的类
1.[代码]写SQL语句(createtable,insertinto)
public class SQL {
//如果需要改动字段,可在createTable方法中修改
public static String createTable(String tablename){
StringBuffer x=new StringBuffer();
x.append("CREATE TABLE If Not Exists`user1`.`").append(tablename).
append("` (`date` DATE NOT NULL,`open` Double,`A` Double ," +
" `B` Double , `C` varchar(10) , `D` Double ," +
"`E` Double ,`F` Double ,`G` Double ,`H` varchar(10)," +
"PRIMARY KEY (`date`));");
return x.toString();
}
//tablename表名,values需要插入的数值
public static String insertInto(String tablename,String values){
String sql="insert