[Logo] Mentawai Forum - Mentawai Web Framework
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 

Forum Read-Only! Check the new site and forum here!

Accessing a database in a Rule for Validation  XML
Forum Index -> General Comments
Author Message
navigo



Joined: 17/06/2008 11:27:55
Messages: 7
Offline

Hello All,

I am trying to write my own rule to use in validation to check values against a database. Is there a graceful way of accessing the C3P0 Pool I created in the ApplicationManager?

I know in my actions, I can refer to input.getValue("pd_conn"), but what is the best way in a rule to access the database? I know I could build a separate connection pool, but I anticipate a number of rules, and I would rather not have that many pools....

Any input is welcome.
RubemAzenha


[Avatar]
Joined: 30/06/2005 23:12:02
Messages: 472
Location: São Paulo, SP
Offline

navigo, in my opinion, those kind of validation are too much specific and should be made in the action's code.


Mentawai Developer
[WWW] [MSN]
navigo



Joined: 17/06/2008 11:27:55
Messages: 7
Offline

RubemAzenha,

Thanks for the feedback. I think I have done that. What I have is using the validation to make sure the input is sane, then I use a "check" method to further check the input - i.e. I use checkEdit or checkAdd which checks the results from an Add or Edit.

Thanks again.
 
Forum Index -> General Comments
Go to:   
Powered by JForum 2.1.6 © JForum Team