Hello Robin
I would recommend starting with an example on how to setup your first Struts webapp..there are many examples but the login form example on the Struts website can be easily modified to fit your situation
http://struts.apache.org/faqs/actionForm.html
then I would use whatever DB tools to concentrate build a SQL Query view (I use Toad and SQLPlus) . The query should do the calculations for you and deliver the delta in the returned resultset
Then I would concentrate on your ActionForm bean accessor
where you would be connecting to the DB and pulling the results back


For getting a high level abstract view for connecting via JDBC Connection go to
http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/connection.html
then to jump into actual example take a look at
http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html
If you get stuck on any or all parts of understanding the implementation I would be more than happy to provide you with any assistance you may need offline..


HTH,
Martin-
001-617-852-7822
----- Original Message ----- From: "Robin Ericsson" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Sunday, February 13, 2005 10:00 AM
Subject: which tier?



Hi,

I'm doing a small timesheet app with struts using PostgreSQL as backend and as I'm new to struts and also somewhat new to Java I'm trying to decide where I should put the logic.

Each row contains a day, start time, end time and break time. Now, I want the business layer to calculate the duration between start time, end time minus the break.

Should this be placed in the SQL-side using a special query, or should I do this in Java? If so, is it possible to calculate durations and intervals in Java without using third-party packages?

I know the question is pretty vague but I'm on thin ice at the moment and not really knowing what I'm doing :)


regards, Robin

---------------------------------------------------------------------
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]



Reply via email to