无为清净楼资源网 Design By www.qnjia.com
作 者: precom (皮蛋)
其中的opDb.java
============================================
package ymbean;
import java.sql.*;
import java.util.*;
import java.text.*;
import com.chinazjj.sql.dsql;
import com.chinazjj.util.dutil;
//其他的包dsql,dutil中的内容我就不再贴了,在本文件中用到的两个函数都很简
单
public class opDb {
private String inquire_value="",inquire_item="",disptype="",inqtyp
e="";
private String inquire_num="",inquire_addr="",inquire_name="";
private dutil ldutil=new dutil();
public opDb() {
}
public void setinquire_item(String name) { inquire_item= name
;}
public void setinquire_value( String name ) { inquire_value = ldut
il.chineseToUnicode(name);}
public void setdisptype(String name) { disptype=name;}
public void setinqtype(String name) { inqtype=name;}
public void setinquire_num( String name ) { inquire_num = ldutil.c
hineseToUnicode(name);}
public void setinquire_addr( String name ) { inquire_addr = ldutil
.chineseToUnicode(name);}
public void setinquire_name( String name ) { inquire_name = ldutil
.chineseToUnicode(name);}
public String getinquire_dndata()
{
return "";
}
public ResultSet executeQuery(String sql)
{
ResultSet rs = null;
Statement lstmt = null;
try {
lstmt = connectdb();
rs = lstmt.executeQuery(sql);
System.out.println("executeQuery: "+sql);
} catch(SQLException ex) { System.err.println("executeQuery: " +
ex.getMessage());}
return rs;
}
public Statement getStmt()
{
Statement lstmt = null;
lstmt = connectdb();
return lstmt;
}
public String executeUpdate(String sql)
{
ResultSet rs = null;
Statement lstmt = null;
try {
lstmt = connectdb();
lstmt.executeUpdate(sql);
System.out.println("executeUpdate: "+sql);
lstmt.executeUpdate("commit");
}
catch(SQLException ex) { System.err.println("executeQuery: " + e
x.getMessage());
return(ex.getMessage());
}
return("executeUpdate ok");
}
public Statement connectdb()
{
Statement lstmt=null;
Connection conn=null;
final String connect_string="jdbc:oracle:thin:scott/tiger@192.168.
0.1:1521:clubdb";
final String driver_string="oracle.jdbc.driver.OracleDriver";
dsql mysql=new dsql();
lstmt=mysql.dconnectdb(driver_string,connect_string);
return lstmt;
}
public Statement connectdb(String connect_string)
{
Statement lstmt=null;
Connection conn=null;
final String driver_string="oracle.jdbc.driver.OracleDriver";
dsql mysql=new dsql();
lstmt=mysql.dconnectdb(driver_string,connect_string);
return lstmt;
}
//=========other function ===================================
public String getCurrentDate(String ldateform)
{
return(new SimpleDateFormat(ldateform).format(new java.util.Date(
)));
}
//========"/n" to "<br>" =====================================
//去掉奇怪的:
public String removeComment(String Content){
String makeContent=new String();
StringTokenizer strToken=new StringTokenizer(Content,"\n");
String tempToken=null;
while(strToken.hasMoreTokens()){
tempToken=strToken.nextToken();
if(tempToken.indexOf(":")!=0)
makeContent=makeContent+tempToken+"\n";
}
return makeContent;
}
//将/n转换成为回车<br>
public String addBr(String Content){
String makeContent=new String();
StringTokenizer strToken=new StringTokenizer(Content,"\n");
while(strToken.hasMoreTokens()){
makeContent=makeContent+"<br>"+strToken.nextToken();
}
return makeContent;
}
//将<br>转换成为回车/n
public String addCr(String Content){
String makeContent=new String();
StringTokenizer strToken=new StringTokenizer(Content,"<br>");
while(strToken.hasMoreTokens()){
makeContent=makeContent+"\n"+strToken.nextToken();
}
return makeContent;
}
//====================================================================
=====
public boolean getIdentify(String name1,String pwd1)
{
try
{
String sql="select * from club_users where username='" + name1 + "'
and password='" + pwd1 + "'";
ResultSet rs = executeQuery(sql);
if(rs.next()) { rs.close(); return(true);}
else { rs.close();return(false);}
}catch (Exception e) { return(false);}
}
public void counts(String pagename)
{
executeUpdate("update call_count set counts=counts + 1 where pagenam
e='"+pagename+"'");
}
//==================张家界市民虚拟社区管理============================
======
public String getDeptSuper(String vp) //取版主
{
String vst="未知";
try{
String sql="select administrator from club_cvcdept where deptno=
'"+vp+"'";
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public String getDeptName(String vp) //取版名
{
String vst="未知";
try{
String sql="select deptnote from club_cvcdept where deptno='"+vp
+"'";
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public String getUserEmail(String vp) //取社区用户email
{
String vst="未知";
try{
String sql="select email from club_users where username='"+vp+"'
";
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public Object getaValue(String vp) //取社区用户email及其他
{
Object vst=null;
try{
String sql=vp;
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getObject(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public String getsValue(String vp) //取社区用户email及其他
{
String vst="";
try{
String sql=vp;
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
}//end opDb.java
其中的opDb.java
============================================
package ymbean;
import java.sql.*;
import java.util.*;
import java.text.*;
import com.chinazjj.sql.dsql;
import com.chinazjj.util.dutil;
//其他的包dsql,dutil中的内容我就不再贴了,在本文件中用到的两个函数都很简
单
public class opDb {
private String inquire_value="",inquire_item="",disptype="",inqtyp
e="";
private String inquire_num="",inquire_addr="",inquire_name="";
private dutil ldutil=new dutil();
public opDb() {
}
public void setinquire_item(String name) { inquire_item= name
;}
public void setinquire_value( String name ) { inquire_value = ldut
il.chineseToUnicode(name);}
public void setdisptype(String name) { disptype=name;}
public void setinqtype(String name) { inqtype=name;}
public void setinquire_num( String name ) { inquire_num = ldutil.c
hineseToUnicode(name);}
public void setinquire_addr( String name ) { inquire_addr = ldutil
.chineseToUnicode(name);}
public void setinquire_name( String name ) { inquire_name = ldutil
.chineseToUnicode(name);}
public String getinquire_dndata()
{
return "";
}
public ResultSet executeQuery(String sql)
{
ResultSet rs = null;
Statement lstmt = null;
try {
lstmt = connectdb();
rs = lstmt.executeQuery(sql);
System.out.println("executeQuery: "+sql);
} catch(SQLException ex) { System.err.println("executeQuery: " +
ex.getMessage());}
return rs;
}
public Statement getStmt()
{
Statement lstmt = null;
lstmt = connectdb();
return lstmt;
}
public String executeUpdate(String sql)
{
ResultSet rs = null;
Statement lstmt = null;
try {
lstmt = connectdb();
lstmt.executeUpdate(sql);
System.out.println("executeUpdate: "+sql);
lstmt.executeUpdate("commit");
}
catch(SQLException ex) { System.err.println("executeQuery: " + e
x.getMessage());
return(ex.getMessage());
}
return("executeUpdate ok");
}
public Statement connectdb()
{
Statement lstmt=null;
Connection conn=null;
final String connect_string="jdbc:oracle:thin:scott/tiger@192.168.
0.1:1521:clubdb";
final String driver_string="oracle.jdbc.driver.OracleDriver";
dsql mysql=new dsql();
lstmt=mysql.dconnectdb(driver_string,connect_string);
return lstmt;
}
public Statement connectdb(String connect_string)
{
Statement lstmt=null;
Connection conn=null;
final String driver_string="oracle.jdbc.driver.OracleDriver";
dsql mysql=new dsql();
lstmt=mysql.dconnectdb(driver_string,connect_string);
return lstmt;
}
//=========other function ===================================
public String getCurrentDate(String ldateform)
{
return(new SimpleDateFormat(ldateform).format(new java.util.Date(
)));
}
//========"/n" to "<br>" =====================================
//去掉奇怪的:
public String removeComment(String Content){
String makeContent=new String();
StringTokenizer strToken=new StringTokenizer(Content,"\n");
String tempToken=null;
while(strToken.hasMoreTokens()){
tempToken=strToken.nextToken();
if(tempToken.indexOf(":")!=0)
makeContent=makeContent+tempToken+"\n";
}
return makeContent;
}
//将/n转换成为回车<br>
public String addBr(String Content){
String makeContent=new String();
StringTokenizer strToken=new StringTokenizer(Content,"\n");
while(strToken.hasMoreTokens()){
makeContent=makeContent+"<br>"+strToken.nextToken();
}
return makeContent;
}
//将<br>转换成为回车/n
public String addCr(String Content){
String makeContent=new String();
StringTokenizer strToken=new StringTokenizer(Content,"<br>");
while(strToken.hasMoreTokens()){
makeContent=makeContent+"\n"+strToken.nextToken();
}
return makeContent;
}
//====================================================================
=====
public boolean getIdentify(String name1,String pwd1)
{
try
{
String sql="select * from club_users where username='" + name1 + "'
and password='" + pwd1 + "'";
ResultSet rs = executeQuery(sql);
if(rs.next()) { rs.close(); return(true);}
else { rs.close();return(false);}
}catch (Exception e) { return(false);}
}
public void counts(String pagename)
{
executeUpdate("update call_count set counts=counts + 1 where pagenam
e='"+pagename+"'");
}
//==================张家界市民虚拟社区管理============================
======
public String getDeptSuper(String vp) //取版主
{
String vst="未知";
try{
String sql="select administrator from club_cvcdept where deptno=
'"+vp+"'";
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public String getDeptName(String vp) //取版名
{
String vst="未知";
try{
String sql="select deptnote from club_cvcdept where deptno='"+vp
+"'";
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public String getUserEmail(String vp) //取社区用户email
{
String vst="未知";
try{
String sql="select email from club_users where username='"+vp+"'
";
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public Object getaValue(String vp) //取社区用户email及其他
{
Object vst=null;
try{
String sql=vp;
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getObject(1);
rs.close();
} catch (Exception e) {}
return vst;
}
public String getsValue(String vp) //取社区用户email及其他
{
String vst="";
try{
String sql=vp;
ResultSet rs = executeQuery(sql);
if(rs.next()) vst=rs.getString(1);
rs.close();
} catch (Exception e) {}
return vst;
}
}//end opDb.java
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年11月13日
2024年11月13日
- 试音宝典《试机四十号K2HD》[低速原抓WAV+CUE]
- 【原神】V5.2攻略 | 暴击爆伤配比 怎样伤害最大化?
- 【原神】V5.2攻略 | 全火元素5星角色·一图流培养
- 【原神】盘点《原神》容易被玩家忽略的大佬角色,很多玩家都不愿意抽他们
- 李玉刚.2017-刚好遇见你【玉泽东方】【WAV+CUE】
- 温拿乐队.1992-永远的记忆【宝丽金】【WAV+CUE】
- 群星.1996-风月电影原声带【滚石】【WAV+CUE】
- Blast Slam S1参赛名单出炉:XG被直邀
- 《英雄联盟》Doinb想让Tian当教练:世纪大和解?
- 《忆蚀》Subliminal:揭秘后室之谜,路知行献声Weplay文化展
- 那英《征服NEWXRCD台湾版》日本压制[WAV+CUE]
- 群星《金曲百分百上》3CD(香港版)[WAV+CUE]
- 刘欢《雨中的树(新歌加精选)2CD》德国HD24K金碟[WAV+CUE]
- 郑源 《世间情歌》6N纯银SQCD[WAV+CUE][1G]
- 群星《粤潮2HQII》头版限量编号[低速原抓WAV+CUE][991M]