aspose file tools*
The moose likes Oracle/OAS and the fly likes JDBC connectivity with Oracle DB on MacBook. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "JDBC connectivity with Oracle DB on MacBook." Watch "JDBC connectivity with Oracle DB on MacBook." New topic
Author

JDBC connectivity with Oracle DB on MacBook.

ven jovovich
Ranch Hand

Joined: Sep 06, 2012
Posts: 33
Hi all,
I have installed Oracle 10g DB on my Macbook exactly as described in: http://www.pythian.com/news/1937/quick-install-guide-for-oracle-10g-release-2-on-mac-os-x-leopard-intel/
In short (according to the above link) I have installed Oracle 10g on my local machine after logging in with username "oracle". Period.

Now, this is what I am doing:
After restarting my machine, I log in with 'XXX' username I open a terminal window and start the oracle database instance by logging in as "oracle".
Then I type the below code which compiles without any error:


Upon trying to run this code, I am facing the following error:


Do I need to install Oracle client for the username 'XXX' and modify the TNSNAMES.ORA file?
Please tell me where I am going wrong.
Regards,
Ven,
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

Yes, you'll need a SID or a service name in the connection string. Check out the Oracle JDBC FAQ.
ven jovovich
Ranch Hand

Joined: Sep 06, 2012
Posts: 33
Hi,
I modified my code as follows:


now the error at runtime is:


and this is the output of tnsping:


Please help.
Regards,
Ven.
Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 459
    
    1
Please refer this for details.


Vinod Tiwari | Twitter
 
jQuery in Action, 2nd edition
 
subject: JDBC connectivity with Oracle DB on MacBook.
 
Similar Threads
Network adapter connection error
SQLException : The Network Adapter could not establish connection
Not able to connect oracle 11.2 using ODBC6.jar
Unable to connect using JDBC
connection of JDBC with oracle 9i database