Accessing Oracle Database from JAVA?

The setup is as follows:
The webserver (internet host server) is in the USA. There is a page for online resume.

The database server (Oracle 8) is in Bangalore, India.

Both these locations have a 64kbps leased line.

When the online resume page is accessed via internet and the resume is submitted after keying in all the details, the data keyed in should get inserted/updated into the database in Bangalore.

Is it possible?

If Yes, How to do it?

If No, any alternatives?
sunithaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ravindra76Commented:

Hi, Try with this

 Class.forName("oracle.jdbc.driver.OracleDriver")

conn = DriverManager.getConnection
             ("jdbc:oracle:thin:@"+x.getOraIP()+":"+
                    x.getOraPort()+":"+x.getOraSID(),
                    x.getOraLogin(),    
              x.getOraPass());

x is a file where your will store private variables and public methods like

    private static String oracleServerIP = "xxx.xxx.xxx.xxx";
    private static String oraclePort = "1521";
    private static String oracleSID = "1521";
    private static String oracleLogin = "name"
    private static String oraclePassword = "password"




 public static String getOraIP(){
        return oracleServerIP;
    }

    public static String getOraPort(){
        return oraclePort;
    }

    public static String getOraSID(){
        return oracleSID;
    }

    public static String getOraLogin(){
        return oracleLogin;
    }

    public static String getOraPass(){
        return oraclePassword;
    }

   
0
sunithaAuthor Commented:
ravindra76:

I have this code with me already and it is working fine.

Let me make it clear to you that the database connection is via the internet from the USA server to my Bangalore server.

Technical details:
The web server and my servlet is on the USA server.

The Oracle database is here in Bangalore.

when I post the online form to my servlet, the details entered in the form should be saved in the oracle tables which is in Bangalore.

with the code u have given I should have a registered IP address for the machine on which the oracle server is installed.

If I have a registred IP address I am leaving the oracle server open to the internet which I dont want to do.
 
0
Ravindra76Commented:
You must have registered ip address for the oracle server.

The same thing. we are doing by putting oracel server in
one machine and webserver in another machine. both are
connected through internet 64kbps line. The servlet which is
invoked from the webserver with  some ipaddress,
will connect to database server through the oracleserver ip address and store the all details entered by the user .
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Ravindra76Commented:
You must have registered ip address for the oracle server.

The same thing. we are doing by putting oracel server in
one machine and webserver in another machine. both are
connected through internet 64kbps line. The servlet which is
invoked from the webserver with  some ipaddress,
will connect to database server through the oracleserver ip address and store the all details entered by the user .
0
Ravindra76Commented:
You must have registered ip address for the oracle server.

The same thing. we are doing by putting oracel server in
one machine and webserver in another machine. both are
connected through internet 64kbps line. The servlet which is
invoked from the webserver with  some ipaddress,
will connect to database server through the oracleserver ip address and store the all details entered by the user .
0
heyhey_Commented:
>> If I have a registred IP address I am leaving the oracle server

you need either internet connection (registered IP address) or LAN connection (Oracle server is behind a firewall)
0
rsalgadoCommented:
Do you want the client (web browser) to save the data directly to the Oracle server? if so, you need to do just what your doing, (Oracle server will be open to internet, less some user id password).  

If you want no one to see the oracle server then you need a 3 tier system where the Browser talks to the oracle server through the web server. Only the web server makes the connections/insert/updates.

Sybase has somthing is its jconnect product which will relay to the server through the web server. This also helps with security issues and the sandbox.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.