Package com.mysql.jdbc

Examples of com.mysql.jdbc.PreparedStatement.executeQuery()


      PreparedStatement preStat = (PreparedStatement) connex
          .prepareStatement(select);

      preStat.setString(1, utilisateur.getPseudo());

      ResultSet rs = preStat.executeQuery();
      exist = rs.next();

    } catch (SQLException ignore) {

    }
View Full Code Here


          .prepareStatement(select);

      preStat.setString(1, utilisateur.getPseudo());
      preStat.setString(2, utilisateur.getMotDePasse());

      ResultSet rs = preStat.executeQuery();
      exist = rs.next();
      //System.out.println(exist);
      if(exist){
        int id = rs.getInt(1);
        utilisateur.setId(id);
View Full Code Here

    try {
      PreparedStatement preStat = (PreparedStatement) connex
          .prepareStatement(select);

      preStat.setString(1, utilisateur.getPseudo());
      ResultSet rs = preStat.executeQuery();

      while(rs.next()){
        solde = rs.getInt(1);
      }
    } catch (SQLException ignore) {     
View Full Code Here

    String select = "SELECT  * FROM `user`";
    try {
      PreparedStatement preStat = (PreparedStatement) connex
          .prepareStatement(select);

      ResultSet rs = preStat.executeQuery();
      while (rs.next()) {
        Utilisateur u = new Utilisateur();
        u.setId(rs.getInt(1));
        u.setPseudo(rs.getString(2));
        u.setNom(rs.getString(3));
View Full Code Here

    connex = getConnection();
    String select = "SELECT * FROM `vente` WHERE `idClient` = ?";
    try {
      PreparedStatement preStat = (PreparedStatement) connex.prepareStatement(select);   
      preStat.setInt(1, c.getId());       
      ResultSet rs = preStat.executeQuery();
      while(rs.next()){
        Vente v = new Vente();
        v.setId(rs.getInt(1));
        v.setIdFilm(rs.getString(2));
        v.setDate(rs.getLong(3));
View Full Code Here

    String select = "SELECT `idFilm`,`date` FROM `vente` WHERE `idClient` = ? AND `type` = ?";
    try {
      PreparedStatement preStat = (PreparedStatement) connex.prepareStatement(select);   
      preStat.setInt(1, c.getId());
      preStat.setString(2, "l");
      ResultSet rs = preStat.executeQuery();
      while(rs.next()){
        String loc[] = {rs.getString(1) , String.valueOf(rs.getLong(2))};
        l.add(loc);
      }
     
View Full Code Here

    connex = getConnection();
    String select = "SELECT  `idFilm` FROM `vente` WHERE `type` = ?";
    try {
      PreparedStatement preStat = (PreparedStatement) connex.prepareStatement(select);   
      preStat.setString(1, type);       
      ResultSet rs = preStat.executeQuery();
      while(rs.next()){
        l.add(rs.getString(1));
      }
    } catch (SQLException ignore) {     
      System.out.println("erreur filmVendu : " + ignore);
View Full Code Here

    connex = getConnection();
    String select = "SELECT `utilise` FROM `bon` WHERE `id`= ?";
    try {
      PreparedStatement preStat = (PreparedStatement) connex.prepareStatement(select);   
      preStat.setInt(1, id);       
      ResultSet rs = preStat.executeQuery();
      while(rs.next()){
        if(rs.getInt(1) == 0){
          int montant = -1;
          String select2 = "SELECT `prix` FROM `vente` WHERE `id` = ?";
          PreparedStatement preStat2 = (PreparedStatement) connex.prepareStatement(select2);   
View Full Code Here

        if(rs.getInt(1) == 0){
          int montant = -1;
          String select2 = "SELECT `prix` FROM `vente` WHERE `id` = ?";
          PreparedStatement preStat2 = (PreparedStatement) connex.prepareStatement(select2);   
          preStat2.setInt(1, id);       
          ResultSet rs2 = preStat2.executeQuery();
          while(rs2.next()){
            montant = rs2.getInt(1);
          }
          return montant;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.