1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
   | public String cb1_action() {
        String Login = this.it1.getValue() + "";
        String Pwd = this.it2.getValue() + "";
        try {
            Connection conn =
                DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "stage2013", "grassi");
            if (conn != null) {
 
                CallableStatement ps = null;
                try {
                    ps = conn.prepareCall("call valid(?,?,?)");
                    ps.setString(1, Login);
                    ps.setString(2, Pwd);
                    ps.registerOutParameter(3, Types.BOOLEAN);
                    System.out.println("*******");
                    ps.executeQuery();
                    Boolean pp = ps.getBoolean(3);
                    if (pp)
                        System.out.println("user_vue : ");
                    else
                        System.out.println("faux");
                } catch (SQLException ex) {
                    System.err.println(ex.toString());
                }
            }
            if (conn != null && !conn.isClosed()) {
                conn.close();
            }
        } catch (SQLException sqle) {
            sqle.getMessage();
        }
       return null;
} | 
Partager