entaroadun
Programmer
This is a simple question, but I am new to Java.
I am prototyping an application in java using a standard 3-tier design. I'd like the application layer to retrieve data from the data layer via ResultSet objects that get passed back from the data layer.
In Visual Basic, this is straightforward: I would create an ADO recordset, disconnect it from the database, then return it.
However, I have read that ResultSets are bound to the Statements that created them, therefore, if the Statement closes, the ResultSet goes away. I cannot use ResultSets to return data, since the Statement object that created the ResultSet will go out of scope at the end of the method call (the data objects are transaction-based and therefore stateless).
Does this mean that I have to create a custom class to hold the data for transport from the data layer to the app layer? I'd like to use the standard JDBC object if possible.
Implementing an XML translate would be a little out of scope for this prototype.
Thanks!
I am prototyping an application in java using a standard 3-tier design. I'd like the application layer to retrieve data from the data layer via ResultSet objects that get passed back from the data layer.
In Visual Basic, this is straightforward: I would create an ADO recordset, disconnect it from the database, then return it.
However, I have read that ResultSets are bound to the Statements that created them, therefore, if the Statement closes, the ResultSet goes away. I cannot use ResultSets to return data, since the Statement object that created the ResultSet will go out of scope at the end of the method call (the data objects are transaction-based and therefore stateless).
Does this mean that I have to create a custom class to hold the data for transport from the data layer to the app layer? I'd like to use the standard JDBC object if possible.
Implementing an XML translate would be a little out of scope for this prototype.
Thanks!