Пример #1
0
  public void conectar(String sql) {

    try {
      conexao = ConnectionFactory.getConnection();
      comando = conexao.prepareStatement(sql);
    } catch (SQLException ex) {
      Logger.getLogger(ClienteDAOBD.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
Пример #2
0
 public void conectarObtendoId(String sql) throws SQLException {
   conexao = ConnectionFactory.getConnection();
   comando = conexao.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS);
 }
Пример #3
0
 public void conectar(String sql) throws SQLException {
   conexao = ConnectionFactory.getConnection();
   comando = conexao.prepareStatement(sql);
 }