Code:
package com.utils;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Connection ;

public class ConnectionManager 
{
  Connection con=null;
  
  public Connection getConnection()
  {
  try{
     String serverName = "172.24.137.30";
  String portNumber = "1521";
  String sid = "ora10G";
  String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
     String username =  "e526938"; 
  String password = "ffGVfacum"; 
  
     try
  {  
  Class.forName("oracle.jdbc.driver.OracleDriver");
  con = DriverManager.getConnection(url,username,password); 
  }
 
  catch (SQLException ex)
  {
     ex.printStackTrace();
  }
}
  catch(ClassNotFoundException e)
  {
   e.printStackTrace();
  }
  return con;
}
}

Last edited by shabbir; 8Dec2011 at 10:23.. Reason: Code blocks