wood burning stoves 2.0*
The moose likes JDBC and the fly likes Using props file for Stored functions and procedures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Using props file for Stored functions and procedures" Watch "Using props file for Stored functions and procedures" New topic
Author

Using props file for Stored functions and procedures

Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
- what are the benefits of moving a stored function or procedure to the props file ?

- As we make the WAR file when we deploy, it always compiles anyway.

- When in production, if I change the function/ procedure in the props file, is it necessarry to redeploy the WAR or just deploy only the props file?

- what are the other logical advantages of pulling a stored procedure/ function from a props file?

Thanks in advance.


Srini
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
149

Puthriah,
Is a props file the same thing as a properties file?

Also, are you comparing it to a stored proc in the database or one defined in the application? The pros/cons would be different in either case.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Hi Jeanne

Props means ...Properties file

I am referring to the Stored function / procedure written in a java app.

what mean to say is that :

Instead of hardcoding in the java source, it would be more flexible to write in a props file as we can modify and the java class files need not be re-compiled.

Thanks in advance
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
149

Puthriah,
Ok. I understand the question now.

Yes, it would be more flexible. In fact, some people externalize all their SQL queries for this reason.

The benefits are flexibility and that a database person can update the stored proc without knowing Java. As long as the stored proc signature doesn't change, this works well. If the signature changes, you have to update the code anyway.

You wouldn't have to redeploy the WAR. You would likely have to restart it though.
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Thanks JB.
As long as the stored proc signature doesn't change :

Can you clarify this a bit?

What I understood is ..

The params we pass. Am i right?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
149

Originally posted by Puthriah Sarma:
The params we pass. Am i right?

Yes. The parameters and the names of the stored proc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using props file for Stored functions and procedures
 
Similar Threads
how we create a war file in j2ee
Spring hibernate issue
Stored Procedures and Session Ejb
Deploying a servlet to tomcat without making war file.
UNIX