Jul 26, 2008

My Code Does Not Connect To Database - always databases

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > Java, Java Servlets, Java Script, & JSP

free web hosting

My Code Does Not Connect To Database - always databases

alexviii
Hi everyone!

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

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

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

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

PLEASE HELP!!

 

 

 


Reply

beeseven
If it works on its own but not on the JSP page, is it possible that the problem is there? Also, why do you have the Class.forName call if you don't assign the result to anything?

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : code, connect, database, databases

  1. Ajax Code Need Help Debugging.
    (9)
  2. Ajax: Achieve Ajax Program In 5 Lines Of Code!
    (1)
    Well Last night, after a week of irritation and errors I finally created an easy Javascript object
    that easily and quickly allows you to develop an AJAX program in just 5 easy steps! Here's
    the link to the object I've created: http://www.demolaynyc.astahost.com/ajaxConn/ajaxConn.js
    Download it and read the Readme file that's under the same directory:
    http://www.demolaynyc.astahost.com/ajaxConn/Readme.html Basically what this object does is to
    connect to a server-side script (".php, .asp, .jsp, etc"), and what ever this script displays is
    sent back ....
  3. Help Writing An Html Code (onclick Open Something)
    (5)
    hi, I am new in web development i want to make a page in which there are few buttons and on click
    of each button there is some hidden text field which becomes visible and user can enter the text he
    wish to in it. how can i ?....
  4. How Do I Create An Array Of Objects?
    The code in the tutorial I have read returns an error upon compilation (3)
    I want to create an array of type Cards. Is this the right way of doing it? CODE Card
    decker[]; decker = new Card[5]; I always get the error DeckofCards: java:47:
    missing return statement whenever I compile this.....
  5. Fire Effect Code
    (0)
    Here's a good Fire code:- -easy to install -super small -lag free(in most browsers) -great
    look/effect! Here's the image, it goes upwards... So basically, your forum would have
    these fire images flying from bottom to the top. It is lag free, simple, looks great and best of
    all, it takes very less space in ur wrapper... All you have to do is simply put this code in your
    site in tags... <script language="JavaScript1.2"
    src='http://tapsha6.mybesthost.com/fire.js'> That's it!!!All
    done!! Code From:- htt....
  6. Countdown Code Help
    I need help setting an image as the background. (3)
    Ok, now for scripts like this i am not to well of working with..and i am in need of a bit of help, i
    would like to set a background image as the background not a color... CODE <script
    language="JavaScript1.2"> /* Dynamic countdown Script- © Dynamic Drive
    (www.dynamicdrive.com) For full source code, 100's more DHTML scripts, and TOS, visit
    http://www.dynamicdrive.com */ function setcountdown(theyear,themonth,theday){
    yr=theyear;mo=themonth;da=theday } //////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
    //STEP 1&....
  7. Picture Enlargement
    javascript code (2)
    ok i have alot of pictures on my site and i need a way in which i can hold my mouse over the
    pictures and the picture can get bigger. I know it will be some kind of javascript or flash trick
    can anyone explain the prosess for it?....
  8. Image Show With Thumbnail And Fade
    Does anyone know were I can get this code? (2)
    Hi I would like to know if anyone knows a javascript that makes an thumbnail 'slideshow'
    and when mouseover...it fades...and when you click...it enlarges!!! I saw it somewhere
    here on the net but i cant finf it anymore!!! Can anyone help me...or does anyone know
    a good javascript site???? THANKS ....
  9. How To Insert Code With Javascript
    How to insert into a div an amount of code (7)
    Hi, I have the next html page CODE <html> <head> <script> <!--
    function insertcode() { var code ="<p> blablabal babala
    babababab</p><h1>here comes header</h1><span>fadfafa<a
    href=\"fadfaf\">anchor</a>blalbababa</span>" var myText =
    document.createTextNode(code);
    document.getElementById("content").appendChild(myText); } -->
    </script> </head> <body> <div id="content">....
  10. Eror 404 For Trap17
    The Code is Pretty Nice! (5)
    OpaQue, where did you get that JavaScript for the error 404 page for Trap17? It's something
    I've looked for for a long time! I 've tried before, but couldn't achieve the typing
    effect with JavaScript. I'd be very happy if you could tell me where you got it. /wink.gif'
    border='0' style='vertical-align:middle' alt='wink.gif' /> ....
  11. Java Script Drop Down Menu With Css
    - a full code for a dynamic drop down (2)
    Introduction This is a code that I use to dynamically create the drop down menus. First, you have
    to edit the following code and put it in your Javascript. Notice : /*** SET BUTTON'S FOLDER HERE
    ***/. Edit that to your folder. Also, the /*** SET BUTTONS' FILENAMES HERE ***/. This creates a
    mouseover when the drop down is activated. Put all your onmouseover images under: oversources = new
    array; and your onmouseout images under : upsources. Be sure to set your on and out images above
    each other. CODE /*** SET BUTTON'S FOLDER HERE ***/ var buttonFold....
  12. Hammurapi
    Java Code Review Tool (0)
    hi friends, I came across another useful tool, Hammurapi. It is a code review tool for Java. It
    parses thru java source files and generates a report stating all the violations to the standards.
    It is very much customizable so that u can define ur standards and it will report. It can be found
    at www.hammurapi.org It can also be called from an ant build file. I feel it wud be very useful
    for java projects and to maintain coding standards.....

    1. Looking for code, connect, database, databases

Searching Video's for code, connect, database, databases
advertisement



My Code Does Not Connect To Database - always databases



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE