• 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

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: 79178
377
  • 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
 
For my next trick, I'll need the help of a tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic