• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

database connectivity in user defined function in servlet

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without showing what the errors are, how can we help you?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't letting a user create a database query a HUGE security risk?

Bill
 
Ranch Hand
Posts: 343
Mac OS X Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
pie. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic