Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Query regarding connection string.

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am new to JDBC. I am trying to connect to oracle database using JDBC.

what should be the first argumen to the following getConnection method?

Connection con = DriverManager.getConnection( "WHAT IS THIS", "username", "password" );


and how should the first argument be determined.

Please let me know.

thanks
chaitanya
 
Marshal
Posts: 76479
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you been through the Java Tutorial? Does that help?
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oracle faq tells you more about: What is the form of a URL.
Regards, Jan
 
hangman
Posts: 220
Angular Framework Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use:


where 192.168.0.100 is my db server.
But be careful. I am using ojdbc14.jar.
So if you are using something else like classes12g.zip, your syntax might be different, like "oracle.jdbc.Driver.OracleDriver" or something..

I hope that helps.

JDBC is really fun. If you can learn it, you can do all sorts of cool things between your Java programs and most databases. Plus, so many other important technologies are based on it.

Good Luck.
 
Chaitanya Vivek
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is this class: new oracle.jdbc.OracleDriver()

I mean- which jar should we include.

Thanks
Chaitanya
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I mean- which jar should we include.



Chaitanya,
I am pointing you again to the Oracle faq:
Where can I get the class files?.

Reading it will get you started.

Regards, Jan
 
Chaitanya Vivek
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hurrah!

I connected to Oracle and fetched data from EMP table.

Thanks for everyone who replied to my queries.

rgds
chaitanya
 
Chaitanya Vivek
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also Thanks to Jan.

The link you pointed is very very informative.

Though I haven't used it now for my small example, I bookmarked the link because the content it has is very rich.

Once again, thanks for such a wonderful article.

Regards
Chaitanya
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic