?
Solved

ResultSet in Weblogic server

Posted on 2001-06-18
5
Medium Priority
?
387 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
[X]
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
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 1000 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

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

765 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