This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

database connectivity in user defined function in servlet

 
shilpa deshmukh-kadam
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before posting this post I read topic "writing the user defined function in servlet" as per 'Ulf Dittmer' suggestion I tried to define new method for making connectivity to database and try to pass connection variable as parameter but It gives error can not find symbol below is my code


I want to call this function in anather class ...can you please help me...Thank you in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without showing what the errors are, how can we help you?
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never ever ever ever ever ever ever ever ever ever ignore exceptions without at least logging them (e.printStackTrace()). Right now you could be getting an SQLException or ClassNotFoundException and not even know it.
 
shilpa deshmukh-kadam
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry to say but I got answer My problem was that I could not create user defined methods in servlet but now I have solution below I put my code i.e solution for methods.

It's all my mistake I could not understand that how to do this now I got solution above are user defined methods which can be accessible in anather servlet class by creating object...
such as

Thank you both to want to help me. In future I will need your help Thank you....!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't letting a user create a database query a HUGE security risk?

Bill
 
Palak Mathur
Ranch Hand
Posts: 321
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Isn't letting a user create a database query a HUGE security risk?

Bill


Agree. Why will you want to pass the query to a public method?
 
shilpa deshmukh-kadam
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for reminding me.
now I correct my mistake i.e about function defined "public".

Thank you both of you..Palak Mathur and William Brogden.


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic