Sunteți pe pagina 1din 2

Java Database Connectivity (JDBC) - Connecting to the Oracle 10g Data...

http://forums.sun.com/thread.jspa?messageID=9632335

Sun.com forums.sun.com

participate
wikis blogs planets forums mediacast Developers Home > Developer Forums > Database Connectivity > Java Database Connectivity (JDBC) > Developer Forums Java Database Connectivity (JDBC) - Connecting to the Oracle 10g Database through Java code Sun Forums Welcome Login Watch List Duke Stars Program M y Forums Feedback FAQ Code of Conduct Back to Forum Feedback About Forums This topic has 1 reply on 1 page. E-mail this Topic [Image] arc_g Connecting to the Oracle 10g Database through Java code Posts:56 Apr 25, 2007 5:00 AM Registered: 5/11/06 I have a Oracle 10g database to be connected to. Through sql plus, I can connect to it using the following command
<div class="jive-quote">sqlplus "sys@pmi as sysdba"</div>

Watch this topic

Reply

Search Forums

and password is 'password' how do I connect to this db through my Java code? I tried
_connection = DriverManager.getConnection("jdbc:oracle:thin:@10.245.4.100:1521:pmi as sysdba", "sys", "password");

but it gave the exception "ExceptionIo exception: Connection refused(DESCRIPTION=(TM P=)(VSNNUM =169869568)(ERR=12505) (ERROR_STACK=(ERROR=(CODE=12505)(EM FI=4))))" I also tried
_connection = DriverManager.getConnection("jdbc:oracle:thin:@10.245.4.100:1521:pmi", "sys", "password");

but this gives the exception "ExceptionORA-28009: connection as SYS should be as SYSDBA or SYSOPER" Can anyone please help me in writing the line of code [Image] cafal Re: Connecting to the Oracle 10g Database through Java code Posts:732 Apr 25, 2007 12:36 PM (reply 1 of 1) (In reply to original post ) Registered: 12/5/97 You need to use the getConnection syntax that requires a Properties object. http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_05 - cafal This topic has 1 reply on 1 page. Back to Forum Read the Developer Forums Code of Conduct Email this Topic Edit this Topic Powered

Reply

1 of 2

10/13/2008 8:47 PM

Java Database Connectivity (JDBC) - Connecting to the Oracle 10g Data...

http://forums.sun.com/thread.jspa?messageID=9632335

Sun Guidelines for Public Discourse | About Sun | About This Site | Newsletters | Contact Us | Employment How to Buy | Licensing | Terms of Use | Privacy | Trademarks

Copyright Sun M icrosystems, Inc.

A S un Developer Network S ite Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. Content Feeds XM L

2 of 2

10/13/2008 8:47 PM

S-ar putea să vă placă și