예제 #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);
 }