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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Reply 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
Greenhorn

Joined: Sep 06, 2012
Posts: 20
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
Bartender

Joined: Oct 01, 2001
Posts: 2539
    
  10

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

Joined: Sep 06, 2012
Posts: 20
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: 458
Please refer this for details.


Vinod Tiwari | Twitter
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JDBC connectivity with Oracle DB on MacBook.
 
Similar Threads
SQLException : The Network Adapter could not establish connection
Unable to connect using JDBC
Network adapter connection error
connection of JDBC with oracle 9i database
Not able to connect oracle 11.2 using ODBC6.jar