这是由于Statement执行了之后,得到ResultSet,直接rs.getString,而没有运行.next()的关系
运行一下.next()即可
Connection conn = DriverManager.getConnection(url_2, tar_username, tar_password);
Statement stmt = conn.createStatement();
ResultSet rs2=stmt2.executeQuery(tmp);
int col2 = rs2.getMetaData().getColumnCount();
rs2.next();
int t_num=Integer.parseInt(rs2.getString(1));