📄 tableexamtypeconcert.java
字号:
package org.wuhang.cjsjk.OldDbToNewDb;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.HashMap;
public class TableExamtypeConcert {
static HashMap<Integer,Integer> id_num = new HashMap<Integer,Integer>();
public static HashMap<Integer,Integer> getID_Num(){
return id_num;
}
public static void examtype_concert(Connection old_con,Connection new_con) {
try {
Statement st = old_con.createStatement();
ResultSet rs = st.executeQuery("select * from grade_type"); int count =0;
while (rs.next()) {
count++;
id_num.put(rs.getInt("id"), count);
PreparedStatement statement = new_con
.prepareStatement("insert into examtype (name) values (?)");
if(rs.getString("type").equals("分数")){
statement.setString(1, "考核");
}
else
statement.setString(1, "考查");
statement.execute();
statement.close();
}
new_con.commit();
rs.close();
st.close();
} catch (Exception e) {
System.out.println("some error");
System.out.println(e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -