Jump to content
Xisto Corporation
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
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.