Hi all,
I have 2 Java class loaded into Oracle one of which has a connection object. The other has to access this connection object by extending the other class. When I extend the class and use the connection variable, it shows null pointer exception. How to acieve this?

Here is the sample code below:
class connect{
public static Connection con = null;

con = DriverManager.getConnection(...);

public static insert(){
Statement stmt = con.createStatement();
stmt.executeUpdate("Insert statement");
public static void main(String a[]){
Connect test = new Connect();

Java prg: InsertTest.java
class InsertTest{
// Without creating an object of connect, I want to call
// insert() method.

On executing the InsertTest.java, it gives me null pointer exception.

I want to get the Connection object without creating an instatnce of connect class. I want achieve connection pooling mechanism. How to that?