Pregunta

Tengo una consulta SQL muy simple y cuando trato de ejecutar, me sale error siguiente

java.sql.SQLException: [BEA][Oracle JDBCDriver]Unhandled sql type  at
weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)  at
weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)  at
            ...

He configurado datatsource WebLogic y utilizando el mismo

Oracle versión: 10 g

versión WebLogic: 9.2

consulta:     tbl_a SELECT. * FROM tbl_a DONDE ID1 = '' e ID2 = ''

¿Fue útil?

Solución

¿Está utilizando un PreparedStatement? Intente especificar valores nulos para cada columna en vez de la cadena vacía, por ejemplo:.

    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try {
      conn = getConnection();
      pstmt = conn.prepareStatement("SELECT tbl_a.* FROM tbl_a WHERE ID1=? AND Id2=?");
      pstmt.setNull(1, java.sql.Types.INTEGER);
      pstmt.setNull(2, java.sql.Types.INTEGER); 
      rs = pstmt.executeQuery();
      while (rs.next()) {
          //capture data from the returned rows
      }
    } catch(Exception e) {
      e.printStackTrace();
    } finally {
      pstmt.close();
      rs.close();
      conn.close();
    }
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top