📄 dbsqlmanager.java
字号:
package hell;import java.sql.*;import hell.*;public class DBSQLManager { protected Connection conn=null; protected Statement stmt=null; protected ResultSet rs=null; protected String sqlStr; public DBSQLManager() { try { sqlStr=""; DBConnectionManager dcm=new DBConnectionManager(); conn=dcm.getConnection(); stmt=conn.createStatement(); } catch(Exception e){ System.out.println(e); } }public Statement getStmt(){ return stmt; }public Connection getConn(){ return conn; }public ResultSet getRs(){ return rs; }public void setSqlStr(String newSqlStr){ this.sqlStr=newSqlStr; }public String getSqlStr(){ return sqlStr; }public void executeQuery() throws Exception{ rs=stmt.executeQuery(sqlStr); }public void executeUpdate() throws Exception{ stmt.executeUpdate(sqlStr); }public void clse() throws SQLException{ if(stmt!=null){ stmt.close(); stmt=null; } conn.close() ; conn=null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -