my dog learned polymorphism
The moose likes JDBC and Relational Databases and the fly likes what to write in DriverManager.getconnection(URL) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "what to write in DriverManager.getconnection(URL)" Watch "what to write in DriverManager.getconnection(URL)" New topic
Author

what to write in DriverManager.getconnection(URL)

jazy smith
Ranch Hand

Joined: Nov 18, 2009
Posts: 101
hi all, after going through many examples on internet, I still couldn't understand what to write in DriverManager.getconnection(URL). URL parameter refers to jdbc:subprotocol:subname kind of form. But please explain me what is subprotocol and what is subname. If I want to write a jdbc program what do I have to write as subprotocol and subname ?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
What exactly goes there depends on what DB server you use (Oracle, Postgres, etc.), on which physical server it resides, and what the name of the database is. You can find the specifics about what to use in the documentation of the JDCB driver of whichever DB server you're using.
 
 
subject: what to write in DriverManager.getconnection(URL)