📄 operation.java
字号:
package server.database;
import java.util.*;
import java.sql.*;
public class Operation {
private Initial database=new Initial();
private void getstat()
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{
if(database.stat==null)
database.getStatement();
}
public int IDU(String sql)
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{
getstat();
return database.stat.executeUpdate(sql);
}
public ResultSet select(String sql)
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{
getstat();
database.rs=database.stat.executeQuery(sql);
return database.rs;
}
private void initRS(String sql)
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{database.rs=select(sql);
}
public void init(String sql)
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{
if(database.rs==null)
initRS(sql);
}
public void closeResultSet()
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{database.closeResultSet();}
public void closeStatement()
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{database.closeStatement();
}
public void closeConnection()
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{database.closeConnection();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -