karamel0510
Messages postés6Date d'inscriptionmardi 7 avril 2009StatutMembreDernière intervention18 mai 2009
-
18 mai 2009 à 12:41
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013
-
18 mai 2009 à 16:46
bon jour j'ai un probleme dans l'authentification d'un utilisateur par exemple "infermier" il doit taper son login et mot de passe et puis cliquer sur valider
pour aller a son compte qui de meme contient des boutons "ajouter patient" et "modifier patient" et moi j'ai cree une base de donnee access et j'ai rempli manuellement les tables infermier, medecin et patient,j'ai fais une connection entre java et access dans le "Action performed "de bouton "valider" de la fenetre de l'authentification infermier mais ca ne marche pas de tout.donc je peut pas acceder a la fenetre compte infermier . et voila le code de la fenetre authentification infermier, s;il vouc plais aidez moi et merci d'avance
je travaille avec Netbeans 6.5 et merci
avec remarque la connection s'etablie mais
les deux messages dans le catch s'affichent: probleme de lecture de la requette et erreurrrr utilisateur. merci bien
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* autehentification_inf.java
*
* Created on 17-May-2009, 14:11:50
*/
/**
*
* @author amouna
*/
public class autehentification_inf extends javax.swing.JFrame {
/** Creates new form autehentification_inf */
public autehentification_inf() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
JButton ss=(JButton)evt.getSource();
if(ss==jButton1)
{ principale prin=new principale();
prin.setVisible(true); }
}
Connection connect=null;
Statement S=null,S1=null;
ResultSet RS=null,RS1=null;
String select,login1,motpass;
int nbcolonnes;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
login1= jTextField1.getText();
motpass= jPasswordField1.getText();
JButton s=(JButton)evt.getSource();
if(s==jButton2)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connect=DriverManager.getConnection("jdbc:odbc:access2007");
System.out.println("connexion avec la base est etablie");
}
catch(Exception e1)
{
System.out.println("connection non etablie");
}
// requette select
try{
S=connect.createStatement();
RS=S.executeQuery("select login,password from identi_mede where login= '"+login1+"' and password='"+motpass+"'");
System.out.println("la requette est lue");
}
catch(Exception e3)
{
System.out.println("probleme de lecture de la requette");
}
try
{