コード例 #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);
 }