📄 presentedsoftware.java
字号:
package downreg;
import java.sql.*;
public class presentedSoftware
{
int L_Id;
int S_Id=0;
int I_Id=0;
int Proffer_Mount=0;
String tableName="largess_software";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
public presentedSoftware()
{
String url="";
String driverName="com.mysql.jdbc.Driver";
String userName="root";
String userPasswd="324802";
String dbName="downreg";
try
{
Class.forName(driverName).newInstance();
url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd+"&useUnicode=true&characterEncoding=gb2312";
con= DriverManager.getConnection(url);
stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
}
catch (Exception e)
{
}
}
public void setL_Id(int id)
{
L_Id=id;
}
public void setS_Id(int id)
{
S_Id=id;
}
public void setI_Id(int id)
{
I_Id=id;
}
public void setProffer_Mount(int mount)
{
Proffer_Mount=mount;
}
public int getL_Id()
{
return L_Id;
}
public int getS_Id()
{
return S_Id;
}
public int getI_Id()
{
return I_Id;
}
public int getProffer_Mount()
{
return Proffer_Mount;
}
public ResultSet LookPresentedSW()//查看已赠送软件
{
try{
String condition="select * from tableName";
rs=stmt.executeQuery(condition);
}
catch(Exception e)
{
}
return rs;
}
public void close()
{
try
{
con.close();
stmt.close();
rs.close();
}
catch (SQLException e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -