Posted on 2007-05-18 17:04
七郎归来 阅读(249)
评论(0) 编辑 收藏
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
String perCode="sgyyfj123";
Connection con;
Statement stmt;
ResultSet rs;
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@10.194.129.49:1521:test", "gdcrm", "gdcrm");
stmt = con.createStatement();
rs = stmt.executeQuery("select * from bbscs_userinfo where username='"+perCode+"'");
if(rs.next()){
System.out.print("有有有有有");
}else{
System.out.print("没没没没没");
stmt.execute("insert into bbscs_userinfo(ID,USERNAME,NICKNAME,PASSWD,REPASSWD,EMAIL,QUESTION,ANSWER,LOGINTIME,LOGOUTTIME,LOGINTIMES,POST,EXP,EXPRESSION,ARTICLENUM,STAYTIME,POWER,HPOWER) " +
"values(BBSCS_USERINFO_SEQ.NEXTVAL,'"+perCode+"','"+perCode+"',000,000,'admin@crm.gdcrm.com.cn','admin','gdcrm',10,10,10,10,10,10,10,10,10,10)");
}
}