• 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

different ways to connect to database

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends,
I heard that there are different ways to connect to database.
Can anyone tell me what are they?

thanks
Karthik Swamy.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure what you are asking here. The four driver types or something else?
 
karthik swamy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Not sure what you are asking here. The four driver types or something else?




i mean by how many ways i can connect the front end application to the database
1. by getConnection method
2.By ClassForName
3.Manually by user interface

so like this by how many ways.

thanks,
Karthik swamy
 
Ranch Hand
Posts: 68
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One problem with your list is that a method called getConnection that can be used on both a java.sql.DriverManager and a javax.sql.DataSource to get a java.sql.Connection, so actually 1 covers 2 methods.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Philip Grove wrote:One problem with your list is that a method called getConnection that can be used on both a java.sql.DriverManager and a javax.sql.DataSource to get a java.sql.Connection, so actually 1 covers 2 methods.


+1. And those are the only methods; all others boil down to these at the end, even though there may be N ways to write code to do so.

I've always been puzzled by this kind of question. "How many ways are there to create an object" is another popular one. Are these interview question? If so, they're strange ones to ask.
 
reply
    Bookmark Topic Watch Topic
  • New Topic