Cheers once again Sumana. I managed to sort out my problem through a process of trial and error but I am not too sure if it is a good way of achieving it. Below are pieces of code from the two classes involved. Would you mind telling me if this is a valid way of doing it and if it is good programming practice:
public class Connection //the class which establishes the connection
{
private static String m_host = "localhost";
private static String m_port = "1521";
private static String m_sid = "weakers";
protected static String schemaName = "system";
protected static String schemaPassword = "hello";
public static OracleConnection conn = null;
public Connection()
{
try
{
String database = "jdbc

racle:thin:@" + m_host + ":" + m_port + ":" + m_sid;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = (OracleConnection)DriverManager.getConnection(database, schemaName, schemaPassword);
}
catch(Exception e){}
}
}
AND code from the second class which calls an instance of Connection in order to execute the SQL:
Connection cont = new Connection();
String query = "Select geom from interstates";
Statement stmt = cont.conn.createStatement();
OracleResultSet ors = (OracleResultSet) stmt.executeQuery(query);
cheers Joe