Skip to content

2020Media

 

Newsflash

Block your brand from becoming a .xxx Find out more.
 
You are here: Home arrow Tools arrow Dynamic Content inc Java arrow Java and Oracle
Java and Oracle PDF Print E-mail

Test your Oracle / Java Account is working {Legacy}

At this point it is assumed that the basic servlets are working. To see how to test this go to Using Servlets

To test that the connection to Oracle is working, open up a web browser and go to

http:// webserver /mountpoint / testDB2020

where

webserver is the name for your web server
mountpoint is the name of the mount points for servlets.

Both of these are in the account detail letter.

This should bring up a page looking like:

2020Media Database Servlet Connection Working

You have connected successfully

If this does not happen, then contact support at Contact Us.

Connecting to Oracle

The following code fragments show the supported method of connecting to Oracle.







import java.sql.*;

import java.io.*;

import java.util.*;


import javax.servlet.*;

import javax.servlet.http.*;

......

public static final String DB_URL = "jdbc:oracle:thin@db_servername:1521:db_database_sid";

public static final String DB_USERNAME = "db_username";

public static final String DB_PASSWORD  = "db_password";

public static final String DB_DRIVER = "oracle.jdbc.driver.OracleDriver";
......

public void init() throws ServletException

{
try
{
Class.forName(DB_DRIVER);
}
catch(java.lang.ClassNotFoundException e)
{
......
}
try
{
con = DriverManager.getConnection(DB_URL,
DB_USERNAME, DB_PASSWORD);
}
catch(SQLException ex)
{
...........
}
where
db_username , db_password, db_servername and db_database_sid are detailed in your account information.

We urge you to use code as close to this as possible, as it aids our debugging of any problems.

The source for the test page is available in the 'src' directory.


More Information

Database Migration Kits: http://technet.oracle.com/
Oracle on Linux: http://technet.oracle.com/tech/linux/
Oracle Documentation: http://technet.oracle.com/docs/content.html
 
< Prev   Next >
Advertisement

Domain Search

Preferred Extensions -
.com .co.uk
.net .org
.me .eu
[+]
  • Narrow screen resolution
  • Wide screen resolution
  • Auto width resolution
  • Increase font size
  • Decrease font size
  • Default font size