Solved

ResultSet in Weblogic server

Posted on 2001-06-18
5
367 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
count8 challlenge 13 87
noX challenge 17 77
What is JNDI datasource in spring 1 38
JAVA part two 5 41
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now