Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC connectivity with Oracle DB on MacBook.

 
ven jovovich
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you'll need a SID or a service name in the connection string. Check out the Oracle JDBC FAQ.
 
ven jovovich
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer this for details.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic