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); } }
public void conectarObtendoId(String sql) throws SQLException { conexao = ConnectionFactory.getConnection(); comando = conexao.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS); }
public void conectar(String sql) throws SQLException { conexao = ConnectionFactory.getConnection(); comando = conexao.prepareStatement(sql); }