Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

jdbc driver problem

Posted on 2006-06-14
9
Medium Priority
?
483 Views
Last Modified: 2008-01-09
Hi,

I have following problem, please can some body tell what happend
to jdbc dirver,

06.13 14:20:39 255] : [Warn] thread [Thread-42] class
[MessageClass] Unable to process message [50128630] reason [oracle.jdb
c.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:825)
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2469)
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1205)
oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559)
mypackage.database.LoggablePreparedStatement.setLong(LoggablePreparedStatement.java:158)
0
Comment
Question by:umar1farooq
  • 5
  • 4
9 Comments
 
LVL 19

Expert Comment

by:actonwang
ID: 16902273
show me your related java code.
0
 

Author Comment

by:umar1farooq
ID: 16903197

The code in class LoggablePreparedStatement

public void setLong(int parameterIndex, long x) throws SQLException {
        ensureCapacity(parameterIndex);
        this.parameters[parameterIndex] = new Long(x);
        stmt.setLong(parameterIndex, x);
    }

 private void ensureCapacity(int i) {
        if(i >= parameters.length) {
            // extend capacity
            Object[] tmp = new Object[parameters.length * 2];
            System.arraycopy(parameters, 0, tmp, 0, parameters.length);
            parameters = tmp;
        }
    }
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16903371
>> stmt.setLong(parameterIndex, x);

      how do you get the statement?


also what " SQLException" you get if that is the error? The message you show is just a [WARN] message. What stacktrace you got when error occurs?

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:umar1farooq
ID: 16905932

In our log files i found only this, nothing else,

06.13 14:20:39 255] : [Warn] thread [Thread-42] class
[MessageClass] Unable to process message [50128630] reason [oracle.jdb
c.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:825)
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2469)
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1205)
oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559)
mypackage.database.LoggablePreparedStatement.setLong(LoggablePreparedStatement.java:158)

Why it is gone To oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559
from my LoggablePreparedStatement.setLong method ?
I think it is not handled by oracle.jdbc.driver.
The code in class LoggablePreparedStatement, This class is very big, i am adding only related methods to this problem,
 Query to stmt is set from other class,

PreparedStatement stmt = null;
    String statement = null;
    Connection con = null;
   
    public LoggablePreparedStatement(Connection con, String statement)
        throws SQLException {

          if (con == null ) {
                String vErrorMsg = "LoggablePreparedStatement.constructor. Passed connection == null";
                CheckedConnectionPool.makeLogMessageError ("LoggablePreparedStatement", vErrorMsg, null, null);                
                throw new NullPointerException (vErrorMsg);
          }      
          
        this.con = con;
       
        // Notice that instances of  the con variable should have, in fact, the PooledConnection type,
        // so prepareStatement to be called is from PooledConnection as well.
       
        this.stmt = con.prepareStatement(statement);
        this.statement = statement;
    }

    public void addBatch() throws SQLException {
        stmt.addBatch();
    }

public void setLong(int parameterIndex, long x) throws SQLException {
        ensureCapacity(parameterIndex);
        this.parameters[parameterIndex] = new Long(x);
        stmt.setLong(parameterIndex, x);
    }

 private void ensureCapacity(int i) {
        if(i >= parameters.length) {
            // extend capacity
            Object[] tmp = new Object[parameters.length * 2];
            System.arraycopy(parameters, 0, tmp, 0, parameters.length);
            parameters = tmp;
        }
    }
0
 
LVL 19

Accepted Solution

by:
actonwang earned 500 total points
ID: 16906159
>>Why it is gone To orac ...

    because you have

 stmt.setLong(parameterIndex, x);

   and stmt is OraclePreparedStatement. type.


Again, I don't see any error but just a warning.

Any paricular error you ran into? if do, what error message?

Or: Can you run your sql portion correctly? Any exception out of it?
0
 

Author Comment

by:umar1farooq
ID: 16909612
The stack trace code is given below.
Try {

 }catch (Exception e) {
             StackTraceElement[] elements = e.getStackTrace();
             StringBuffer buf = new StringBuffer();
             for (int a=0;a<elements.length;a++) {
                 buf.append(elements[a]).append("\n");
             }
             long mid = -1;
             if (message != null) {
                 mid = message.getId();
             }
             log.warn("Unable to process message [" + mid + "] reason [" + buf.toString() + "]");
             // add the exception to the list of exceptions occurred
             m_exceptions.addElement(e);
          }

and the following is coming in the  stack trace,
06.13 14:20:39 255] : [Warn] thread [Thread-42] class
[MessageClass] Unable to process message [50128630] reason [oracle.jdb
c.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:825)
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2469)
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1205)
oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559)
mypackage.database.LoggablePreparedStatement.setLong(LoggablePreparedStatement.java:158)

The query is very simple,
 public static final String DELETE_SQL = "DELETE FROM MT_MESSAGE_QUEUE WHERE id = ?";
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16910451
add this below:

 log.warn("Unable to process message [" + mid + "] reason [" + buf.toString() + "]");

 log.warn("exception: ",e);

what do you see?
0
 

Author Comment

by:umar1farooq
ID: 16912160
It will take some time, to install changes to production,
This problem occured only on production.
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16912251
somehow, you missed the error message .. so I am not sure what problem you have.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question