Fedora Linux Support Community & Resources Center
  #1  
Old 18th July 2009, 04:06 PM
creeping death's Avatar
creeping death Offline
Registered User
 
Join Date: Feb 2008
Posts: 655
how to connect java with oracle in linux?

i have oracle and netbeans installed...i wish to connect oracle to java...i cannot figure out the jdbc stuff, in linux...

in windows, what i used to do was...

1. add a data source in odbc administrator ( microsoft odbc for oracle)
2. then load oracle driver
Code:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
3. create a jdbc connection
Code:
 Connection con=DriverManager.getConnection("jdbc:odbc:dsn","username","password");
i m not able to understand how to perform steps 1 and 2... on linux i have never done this on linux before...i dont know what oracle drivers are there for linux and who provides them and where and how to add/install them...
__________________
c_d -- superfluously plenteous yet indolently otiose
Reply With Quote
  #2  
Old 18th July 2009, 04:56 PM
RupertPupkin's Avatar
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 4,619
You don't need to use an ODBC bridge in Linux, just use JDBC directly:
Code:
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
conn = DriverManager.getConnection("jdbc:oracle:thin:@host:1521:sid","user","password");
where "host" is the hostname of the Oracle server, 1521 is the port number, and "sid" is the Oracle SID name in your tnsnames.ora file.
Reply With Quote
  #3  
Old 18th July 2009, 06:15 PM
creeping death's Avatar
creeping death Offline
Registered User
 
Join Date: Feb 2008
Posts: 655
thanks RupertPupkin
__________________
c_d -- superfluously plenteous yet indolently otiose

Last edited by creeping death; 18th July 2009 at 07:04 PM.
Reply With Quote
Reply

Tags
connect, java, linux, oracle

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle Enterprise Linux JohnnyLinux Linux Chat 10 16th September 2009 05:00 PM
installing java to support oracle 9i !! omanicool Installation and Live Media 1 9th September 2006 07:53 AM
libcwait.so -> Java -> Oracle strahd Using Fedora 0 8th May 2006 10:04 AM
Oracle Linux...? Mtnear Linux Chat 5 20th April 2006 08:15 PM
Oracle CPU Patch for Linux for 10.2.0.1 traveller Using Fedora 2 26th January 2006 07:13 PM


Current GMT-time: 13:44 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat