check out the Petstore example for ideas on how to access databases from flow. I'm using flow to access an Informix database and a MySql database.
Its a snap.
I take Joerg's point about the separation of concerns, however but if you design your flowscripts carefully you can still achieve some semblence of SOC, for example, I shove all my database actions into a separate flow script (usersDB.js for example).
The main advantage it offers me is that I'm not mired in coding Java all day. If I need to swap to a java based data access I can make the calls from my userDB.js script.
Hope this helps.
Tony
Joerg Heinicke wrote:
On 27.01.2004 13:14, Joose Vettenranta wrote:
Hello,to
I've seen lot's of discussion back and forward on the subject "how to
save/retrieve data from SQL-server from flow-script" but I have never really seen any answers how to do that. So, how can I do simple UPDATE
command to database from flow script?
Don't do this in the FlowScript because it is only the controller. Updating the model is part of business logic and so do this stuff in Java classes that you call from the flow script: Separation of Concerns.
Joerg
basic structure of my flow script is:
do { SendPageAndWait ("foo", "page: page); if (cocoon.request.get (stuff) matches logical expression)) { UPDATE table SET stuff=valueFromForm page++; } } while (page < 10);
that is the basic structure of the flow script I'm trying to create.
- Joose
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
