Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using props file for Stored functions and procedures

 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- 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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Puthriah Sarma:
The params we pass. Am i right?

Yes. The parameters and the names of the stored proc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic