Solved

ResultSet in Weblogic server

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

863 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

23 Experts available now in Live!

Get 1:1 Help Now