Register.java~9~
资源名称:Java.rar [点击查看]
上传用户:liming9091
上传日期:2014-10-27
资源大小:3376k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package uml_gaokai;
- import com.borland.dx.sql.dataset.*;
- import java.sql.*;
- import javax.swing.*;
- /**
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
- * @author unascribed
- * @version 1.0
- */
- public class Register {
- public Register( String userName , int userAge , String userGender , String userAuthority ,String userAddress ,String userPassword , String testPassword ){
- if(userPassword.equals(testPassword)){
- try{
- Database database1 = new Database();
- database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:odbc:gaokaiSQL", "sa", "", false, "sun.jdbc.odbc.JdbcOdbcDriver"));
- Statement sql1 = database1.createStatement() ;
- //JOptionPane.showMessageDialog(null,"注册成功,请重新登陆","",JOptionPane.DEFAULT_OPTION);
- sql1.executeUpdate("INSERT INTO [UML_CS].[dbo].[user](userName, userAge , userGender, userAuthority , userAddress , userPassward) VALUE('"+userName+"' , '"+userAge+"' , '"+userGender+"' , '"+userAuthority+"' , '"+userAddress+"','"+userPassword+"')") ;
- System.out.print("aa");
- }
- catch(SQLException www){}
- }
- else{
- JOptionPane.showMessageDialog(null,"您输入的密码前后不符,请重新输入","",JOptionPane.DEFAULT_OPTION);
- }
- }
- }