• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

Running jdbc methods from my application

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jdbc.class which executes queries etc.

I also have an application class.

When the app runs I'd like to to execute some methods in the jdbc to perform queries, how do I go about doing this?

I know how to call methods but I have to pass the connection paramter which has not been setup in my applicatoin class.

author & internet detective
Posts: 40282
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend having a separate class that handles creating the connection. Then your class containing the JDBC can call it and you don't need to pass the connection around all over.
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic