注册信息的验证

public void ZhuCeYangZheng(String a,String b,String c) {
		 try {
			conn = getConnection();
			String sql = "select *from master where name = ?";
			stmt = conn.prepareStatement(sql);
			stmt.setString(1, a);
			rst = stmt.executeQuery();
			if(rst.next()) {
				JOptionPane.showMessageDialog(null,
						"该用户已经存在",
						"提示信息",
						JOptionPane.ERROR_MESSAGE);
				
			}else {
				//this.ZhuCe(a, b, c);
				
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			closeAll();
		}
		 
	}

 

你可能感兴趣的:(登入注册信息的验证)