Solved

ResultSet in Weblogic server

Posted on 2001-06-18
5
377 Views
Last Modified: 2013-11-24
Hi,
I have been trying to make a EJB Session bean (using WebGain StudioPro 4.1) that retrieves a ResultSet from a MSSQL database and process the data. Everything seams to go OK until I try to perform any operation on the ResultSet I get back from the database.

For example the code below works fine for creating a table in the database:

Statement stmt = dbConnection.createStatement();
stmt.executeUpdate("CREATE TABLE TEST (TEST1 INTEGER, TEST2 VARCHAR(32))");
stmt.executeUpdate("INSERT INTO TEST VALUES (1,'RAD 1')");
stmt.executeUpdate("INSERT INTO TEST VALUES (2,'RAD 2')");
stmt.executeUpdate("INSERT INTO TEST VALUES (3,'RAD 3')");

But if I try to get a ResultSet and call for example first() or absolute(1) the WebLogic server (5.1) crashes. Example code that makes it crash is:

ResultSet rs = stmt.executeQuery("SELECT TEST2 FROM TEST");
rs.first();
 
Anybody experienced anything like this and may help me work around this problem?
0
Comment
Question by:Krafer
5 Comments
 
LVL 10

Expert Comment

by:Nushi
ID: 6203865
try to change this line:
Statement stmt = dbConnection.createStatement();
PrepareStatment stmt = dbConnection.PrepareStatement(String...);

ResaultSet rs=stmt.getResaultSet();

and see whats happened.


Nushi.
0
 

Author Comment

by:Krafer
ID: 6204218
Thanks for the comment but it still crashes. The exception and error message I get is:

java.rmi.RemoteException:
java.lang.AbstractMethodError
   at weblogic.jdbc20.pool.ResultSet.first(ResultSet.java:101)
   at weblogic.jdbc20.rmi.internal.ResultSetImpl.first(ResultSetImpl.java:521)
   at weblogic.jdbc20.rmi.SerialResultSet.first(SerialResultSet.java:793)
   at com.telenor.mhp.contentlog.ContentLogEJB.getDBConnection(ContentLogEJB.java:135)
   at com.telenor.mhp.contentlog.ContentLogEJBEOImpl.getDBConnection(ContentLogEJBEOImpl.java:104)
   at com.telenor.mhp.contentlog.ContentLogEJBEOImpl_WLSkel.invoke(ContentLogEJBEOImpl_WLSkel.java:83)
   at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java:347)
   at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:77)
   at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:15)
   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
; nested exception is:

Anybody make any sense og this?
0
 
LVL 2

Accepted Solution

by:
Prasanna_Hebbar earned 250 total points
ID: 6204390
The implementation for this method is not supported by WebLogic. The version of weblogic which you have does not have the support for JDBC2.0. That is why it gives the error AbstractMethodError.

So you have to use only rset.next() to navigate through the result set. (If you need the support of navigating back to the first one, you might want to store the objects in vector).

Refer to the api documentation of next(). That might be enough for you.
0
 
LVL 3

Expert Comment

by:sghosh092199
ID: 6204397
Hi!

You can try the following:

PrepareStatment stmt = dbConnection.PrepareStatement("SELECT ..");

ResultSet rs=stmt.executeQuery();

The AbstractMethodError occurs if there is an incompatibility between the calling method and the called method at runtime. Say,

you have a method abc(String str1, String str2). You call it as abc(int). Now it is always caught at compile time but consider the fact that you compile calling method, change the method signature and compile called method without compiling the former.

Since the error is occurring in the built-in functions, check there is a version compatibility. The first() method applies for JDBC 2.0

Hope that helps!



0
 

Author Comment

by:Krafer
ID: 6205284
Thank you very much. The solution is not always difficult :-)
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

749 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