Jump to content
xisto Community
Sign in to follow this  
alexviii

My Code Does Not Connect To Database always databases

Recommended Posts

Hi everyone!

i am having a database connection problem,
i am using this code to connet to the database -

*******************attempCounter = 0****

public static Connection getDbConnection(String p_db, String p_schema){Connection conn = null;int attemptCounter = 0;while (conn==null && attemptCounter<3){attemptCounter++;try{ResourceBundle rb = ResourceBundle.getBundle("hailEss");String dbName = rb.getString("db.name." + p_db);//if(p_schema.equals("custom"))//p_schema="haileip";String dbUser = p_schema;String dbPass = rb.getString("db.pass." + p_db + "." + p_schema);System.out.println(dbName);System.out.println(dbUser);System.out.println(dbPass);Class.forName("oracle.jdbc.driver.OracleDriver");conn = DriverManager.getConnection(dbName,dbUser,dbPass);}catch(Exception genEx){EssLocalLogger logMakerObj = new EssLocalLogger();logMakerObj.error("Source ConnectionManager.getDbConnection(): " + attemptCounter + " - " + genEx.toString());}}return conn;}

********************

now the problem is when i run this class i get the connection in the first place itself, but when i call this through a jsp page it tries for 3 times, it gets the connection and comes out with this error which is why i am able to proceed firther----

****************** Exception: java.sql.SQLException: ORA-00600: internal error code, arguments: [tt
cgcshnd-1], [0], [], [], [], [], [], []
******************


PLEASE HELP!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.