sp; System.out.print(rs.getString("TABLE_NAME")+" "); System.out.print(rs.getString("COLUMN_NAME")+" "); System.out.print(rs.getInt("DATA_TYPE")+" "); System.out.println(rs.getString("TYPE_NAME")); } rs.close(); stmt.close(); con.close(); } catch(SQLException ex) { System.err.println("SQLException: " + ex.getMessage()); } } public static String getInput(String prompt) throws SQLException { System.out.print(prompt); System.out.flush(); //清除所有字符 try { java.io.BufferedReader bin; //创建从字符输入流中读取文本的对象 bin = new java.io.BufferedReader( //字符流为参数 new java.io.InputStreamReader(System.in)); //字节流为参数,转化成字符流 String result = bin.readLine(); return result; //返回字符串 } catch(Exception e) { System.out.println(e); return ""; } } }
上一页 [1] [2] [3] |