Hi there,
I'm a newbie to Flash Remoting. I'm having difficulty transferring a result
set to flash using an intermittent rowset, can anyone help?
The result to flash is null with either of the implementations (commented &
uncommented).
import java.sql.*;
import javax.sql.rowset.CachedRowSet;
import com.sun.rowset.CachedRowSetImpl;
public class JavaClassService {
public ResultSet getResultSet(){
Connection connection = null;
try{
Class.forName( "com.mysql.jdbc.Driver" );
connection = DriverManager.getConnection(
"jdbc:mysql://localhost/test", "root", "space7107");
Statement stmt = connection.createStatement();
ResultSet resultset = stmt.executeQuery("SELECT * FROM testdata");
CachedRowSet crs = new CachedRowSetImpl();
//crs.setUsername("root");
//crs.setPassword("space7107");
//crs.setUrl("jdbc:mysql://localhost/test");
//crs.setCommand("SELECT * FROM testdata");
//crs.execute();
crs.populate(resultset);
resultset.close();
stmt.close();
connection.close();
return crs;
}catch(Exception e){
}finally{
try{
if(connection!= null && !connection.isClosed()) connection.close();
}catch(SQLException e){}
}
return null;
}
}
cyberluna - 16 Apr 2007 15:21 GMT
In case anyone has this problem - Sun 1.5 is required to use CachedRowset - I
had been trying to use 1.4 and the rowset.jar, which wasn't working. Both
commented&uncommented java code work fine with flash remoting.