📄 tbmodeltool.java.svn-base
字号:
package safechatserver;/* * TbModelTool.java * * Created on 2008-11-23, 19:10:12 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */import java.util.*;import java.sql.*;/** *琛ㄦ牸鏁版嵁鎿嶄綔宸ュ叿 * @author DJ灏愯垶 */public class TbModelTool { Vector data; Vector titles; Connection connect; Statement state; ResultSet rs; public TbModelTool() { data = new Vector(); titles = new Vector(); connectDB(); //showResultSet(data,titles); } void connectDB() { try { Class.forName("com.mysql.jdbc.Driver"); connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/SecurityChat", "root", "111111"); } catch (ClassNotFoundException e) { System.out.println("JDBC driver not loaded:\n" + e); } catch (SQLException e) { System.out.println("Connection failed:\n" + e); } } void initTool(Vector data, Vector title) { this.data.clear(); this.titles.clear(); } void showResultSet(String sql, Vector data, Vector title) { try { state = connect.createStatement(); rs = state.executeQuery(sql); ResultSetMetaData rsd = null; rsd = rs.getMetaData(); int i = 0; //灏嗘爣棰樻斁鍏
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -