Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ResultSet in Weblogic server

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

840 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