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,'[email protected]','admin','gdcrm',10,10,10,10,10,10,10,10,10,10)");
}
}