Re: Serializing PreparedStatement, or: how do create a database history?
- From: Thomas Hawtin <usenet@xxxxxxxxxxxxxxxxx>
- Date: Fri, 02 Sep 2005 20:08:37 +0100
Chris wrote:
We have a Database (MS SQL over JDBC) which is not always necessary accessible. But this fact has to be transparent for the application which uses the db. If the db is not available, all updates/inserts and deletes must be saved (persistent on the harddisk!) and later be executed on the database (SQL select is not needed).
I first thought about serializing the PreparedStatement, but first of all it is not serializable, second, all status about the database is lost.
Simply saving the SQL string does not help, as there can be binary objects in the query which are set using the PerparedStatement.
As this is an extension to an existing program, and PreparedStatement is used there all over, building something around the PreparedStatement seems like the only solution.
I would step a layer backwards. Encapsulate all updates in command objects. This will also help you serialize updates that require multiple statements. With control of the command object implementation you can do what you like.
Tom Hawtin -- Unemployed English Java programmer http://jroller.com/page/tackline/ .
- Prev by Date: Re: Serializing PreparedStatement, or: how do create a database history?
- Next by Date: Re: Serializing PreparedStatement, or: how do create a database history?
- Previous by thread: Re: Serializing PreparedStatement, or: how do create a database history?
- Next by thread: Re: Serializing PreparedStatement, or: how do create a database history?
- Index(es):