最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
通用数据库操作BEAN
时间:2022-07-02 18:21:40 编辑:袖梨 来源:一聚教程网
通用数据库操作BEAN
package pkgCDB;
import java.text.*;
import java.util.*;
import java.sql.*;
public class clsCDB
{
String sDBDriver = "";
String sConnStr = "";
String sHint = "";
ResultSet rs = null;
Connection conn = null;
Statement stmt = null;
public String getHint()
{
return sHint;
}
public void setDBDriver(String s)
{
sDBDriver = "" + s;
}
public String getDBDriver()
{
return sDBDriver;
}
public String getConnStr()
{
return sConnStr;
}
public void setConnStr(String s)
{
sConnStr = "" + s;
}
public ResultSet getResultSet()
{
return rs;
}
//Initialize the database
public boolean Initialization(String dbDrive,String dbConn)
{
sDBDriver = dbDrive;
sConnStr = dbConn;
return Initialization();
}
public boolean Initialization()
{
try
{
Class.forName(sDBDriver);
sHint = "Initialization sucessfully"; return true;
}
catch(java.lang.ClassNotFoundException e) {
sHint = "Initialization : " + e.getMessage();
return false;
}
}
//A common function perhaps usable
public String chkStr(String inStr)
{
StringBuffer result = new StringBuffer("");
char cc;
if (inStr != null)
{
for (int i = 0; i < inStr.length(); i++)
{
cc = inStr.charAt(i);
if (cc == )
{
result.append();
}
result.append(cc);
package pkgCDB;
import java.text.*;
import java.util.*;
import java.sql.*;
public class clsCDB
{
String sDBDriver = "";
String sConnStr = "";
String sHint = "";
ResultSet rs = null;
Connection conn = null;
Statement stmt = null;
public String getHint()
{
return sHint;
}
public void setDBDriver(String s)
{
sDBDriver = "" + s;
}
public String getDBDriver()
{
return sDBDriver;
}
public String getConnStr()
{
return sConnStr;
}
public void setConnStr(String s)
{
sConnStr = "" + s;
}
public ResultSet getResultSet()
{
return rs;
}
//Initialize the database
public boolean Initialization(String dbDrive,String dbConn)
{
sDBDriver = dbDrive;
sConnStr = dbConn;
return Initialization();
}
public boolean Initialization()
{
try
{
Class.forName(sDBDriver);
sHint = "Initialization sucessfully"; return true;
}
catch(java.lang.ClassNotFoundException e) {
sHint = "Initialization : " + e.getMessage();
return false;
}
}
//A common function perhaps usable
public String chkStr(String inStr)
{
StringBuffer result = new StringBuffer("");
char cc;
if (inStr != null)
{
for (int i = 0; i < inStr.length(); i++)
{
cc = inStr.charAt(i);
if (cc == )
{
result.append();
}
result.append(cc);
相关文章
- 人们熟悉的寄居蟹属于以下哪种分类 神奇海洋11月21日答案 11-21
- 第五人格11.22共研服有什么更新 11月22日共研服更新内容介绍 11-21
- 原神恰斯卡怎么培养 11-21
- 无期迷途四星装束是谁 11-21
- 王者荣耀帝丹高中校服怎么获得 11-21
- 光遇姆明季后续版本怎么玩 11-21