• 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Two ways to get Connection object.

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1. DriverManager.getConnection(String url);
#2. Driver driver = DriverManager.getDriver(url);
driver.connect(url);
I want to know, the difference between them, which one to use under what requirement ?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Vishal Saxena:
#1. DriverManager.getConnection(String url);
#2. Driver driver = DriverManager.getDriver(url);
driver.connect(url);
I want to know, the difference between them, which one to use under what requirement ?



Hi Vishal,
Just go through the java documention and API for SQL it will give u a clear picture and difference of the statements u have given.
regards,
Krishna
 
Vishal Saxena
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey krishna,
Can you elaborate ?
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic