Hello:

I don't know if this is a bug or any other problem....

I've downloaded the last jdbc driver from ftp.sap.com. (Before I tried
with the sapdbc.jar jdbc driver which is installed with the distribution
with the same result).

I'm using SAPDB 7.3.0.32 (The last suitable version for Solaris 7 in a
Ultra 5 computer).

I have this stored procedure:

CREATE DBPROC prueba (OUT p_res VARCHAR(50) ) AS
BEGIN
SET p_res = 'I am trying';
STOP(0);
END;

I have this code in Java:
.....
      CallableStatement st = null;
      String res = null;
      try {
         st = _con.prepareCall("{call carre.prueba(?)}");
         st.registerOutParameter(1, Types.VARCHAR);
         st.execute();
         st.close();
         res = st.getString(1);
      } catch (SQLException e) {
         _error = e.getErrorCode();
         System.out.println("Error. " + e.getMessage() + " :" +
              e.getErrorCode());
         return null;
      }

.....

And everything is ok until the CallableStatement.getString method is
invoked. This is the exceptions I get. This exception is independent of
the OUT parameter (I mean. I'be tried with  getInteger, getFloat, etc...
Obviusly whith different stored procedures):

Exception in thread "main" java.lang.NullPointerException
        at
com.sap.dbtech.jdbc.translators.DBTechTranslator.isNull(DBTechTranslator.java:790)

        at
com.sap.dbtech.jdbc.translators.StringTranslator.getString(StringTranslator.java:235)

        at
com.sap.dbtech.jdbc.CallableStatementSapDB.getString(CallableStatementSapDB.java:1176)

        at ClaseConsultasSAPDB.prueba(ClaseConsultasSAPDB.java:26)
        at ClasePrincipal.main(ClasePrincipal.java:18)

Thanks.

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to