CachedRowSet and WebMethods GLUE
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Philipp_Helle
Posted On:   Monday, July 18, 2005 10:27 AM

Hi, I'm trying to implement a web service which has to execute SQL queries and give back the results to the client. I'm using WebMethods GLUE, MySQL Connector/J 3.1, J2SE 1.5 and the RowSet API from SUN. The Client code looks like this: // bind to web service whose WSDL is at the specified URL String url = "http://localhost:8004/glue/sqlexecutor.wsdl"; ISQLExecutor sqlExecutor = (ISQLExecutor)Registry.bind( url, ISQLExecutor.class ); if (!sqlExecutor.isConnected()) { sqlExecutor.connect(); } if (sqlExecutor.isConnected()) { System.out.println("Service is connected to Database."); }    More>>

Hi,


I'm trying to implement a web service which has to execute SQL queries and give back the results to the client.


I'm using WebMethods GLUE, MySQL Connector/J 3.1, J2SE 1.5 and the RowSet API from SUN.


The Client code looks like this:

			
// bind to web service whose WSDL is at the specified URL
String url = "http://localhost:8004/glue/sqlexecutor.wsdl";
ISQLExecutor sqlExecutor = (ISQLExecutor)Registry.bind( url, ISQLExecutor.class );
if (!sqlExecutor.isConnected()) {
sqlExecutor.connect();
}
if (sqlExecutor.isConnected()) {
System.out.println("Service is connected to Database.");
}
String query = "SELECT * FROM umfragen";
CachedRowSetImpl rs = sqlExecutor.doQuery(query);
while (rs.next()) {
System.out.println(rs.getString("name"));
}



And the server implementation is as follows:

			
public CachedRowSetImpl doQuery(String query) {
Statement stmt = _connection.createStatement();
ResultSet rs = stmt.executeQuery(query);
CachedRowSetImpl rSet = new CachedRowSetImpl();
System.out.println("Populating RowSet");
rSet.populate(rs);
System.out.println("RowSet populated");
rs.close();
stmt.close();
System.out.println("Connection closed");
return rSet;
}



Problem is, it doesn't work.
Here is the debugger output:

			
[STARTUP] Glue Standard 5.0.2 build 77 (c) 2001-2004 webMethods, Inc.
Service is connected to Database.
Test
Exception in thread "main" electric.util.WrappedException: java.rmi.UnmarshalException: java.io.IOException: no argument constructor is missing. java.lang.InstantiationException: javax.sql.rowset.RowSetMetaDataImpl$ColInfo
at electric.proxy.handler.Proxy.getCompatibleException(Unknown Source)
at electric.proxy.handler.Proxy.invoke(Unknown Source)
at $Proxy0.doQuery(Unknown Source)
at net.eads.eqip.impl.SQLTester.main(SQLTester.java:49)
Java Result: 1


I thought that CachedRowSet was designed to be used for things like RMI and web services and now I'm getting these exceptions.



I would appreciate any help.



Cheers

Philipp

   <<Less
About | Sitemap | Contact