• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Accessing oracle from remote machine

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running a JSP application on Tomcat Server with oracle 8i as database.
Oracle server is maintained on a seperate machine and all the developers access the same Oracle server for developing while they have tomcat installed seperately on their respective machines.
If i install tomcat on the machine in which oracle is installed and try to access oracle using the following code in my JSP, it works perfectly fine.
Class.forName("oracle.jdbc.driver.OracleDriver");
return DriverManager.getConnection ("jdbc racle:thin:@127.0.0.1:1521 rcl", "scott", "tiger");
But if the same code(changing the ip to oracle server's id, so the code would be
return DriverManager.getConnection ("jdbc racle:thin:@192.168.27.32:1521 rcl", "scott", "tiger");
), is used by a developer in his JSP using his local tomcat server and trying to access the orace server, she gets the following error.
java.sql.SQLException:Io Exception: The Network adapter could not establish a connection.
What we want to acheive is that although every developer has a web server seperately on her machine, the oracle server should be installed on only one machine and each developer should access that for developing her JSP application.
Thanks
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each machine needs the Oracle client installed on it. Then you put your server information into your tnsnames.ora file. Then everyone will be able to access the Oracle server. You can ask your DBA for help on this.
Mark
 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you running oracle personal edition? if so you cant connect from other boxes.
 
Angela lewis
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<quote>
are you running oracle personal edition? if so you cant connect from other boxes
</quote>
No I am using Oracle 8i Enterprise Edition
 
author & internet detective
Posts: 42163
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Angela,
Do you have a firewall that could be blocking the ports?
 
Angela lewis
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone for replying.
No I don't have a firewall installed.
Is installing the Oracle clients the only way, can't it be done without that?
If i do install Oracle client what else needs to be done after that?
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
make sure you can ping the boxes (i.e. check subnet masks), check the listener is running, check with sqlplus..
you dont need sqlnet (i.e. oracle client) or tnsnames.ora installed & setup to use the thin driver (just the classes12.zip) like you are doing.
maybe have a look at the 'ask tom' website for more ideas.
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"you dont need sqlnet (i.e. oracle client) or tnsnames.ora installed & setup to use the thin driver (just the classes12.zip) like you are doing."
That is true. I forget that that is the wonder of the thin driver, in that you don't need to install the client on the clients.
SJ has very good suggestions.
Here is the link to Ask Tom.
Mark
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Angela lewis:
Thanks everyone for replying.
No I don't have a firewall installed.
Is installing the Oracle clients the only way, can't it be done without that?
If i do install Oracle client what else needs to be done after that?



You don't have to install any oracle client as you are using only jdbc.
Make sure the remote machine is accessible.
Did you ping?
 
Angela lewis
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Did u Ping


Yes i did ping and it pings fine.
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do a "netstat -a" & make sure oracle is listening on port 1521
do you have some sort of personal firewall running?
 
Angela lewis
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


do a "netstat -a" & make sure oracle is listening on port 1521


I did netstat -a and oracle is listeneing on port 1521

do you have some sort of personal firewall running?


No i have no firewall running
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic