Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can not connect to the database

 
Johny Harris
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii,

I have the following problem:
- I wrote a basic JSP Coding to save an User-Account (Login and Password) to the Database.
- I have 2 Inputfields in my JSP file (Logon+Password), the value of these Inputfields are given to a Bean.
- My Bean has the coding below:



My problem is, I can not estabilish a connection with the database with this coding. Manually I can start my database with the above values.
My other problem is, if I set a breakpoint somewhere in the method public void createConnection()... , my application is never stopping at this breakpoint, so I can not debugging my coding. But if I set a breakpoint somewhere else, I can debug my coding without any problems.

Can anybody help me?

Kind Regards,
Johny Harris
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, you should drop the 'newInstance()' from Class.forName(driverName).newInstance();

My other problem is, if I set a breakpoint somewhere in the method public void createConnection()... , my application is never stopping at this breakpoint

Where are you calling the createConnection() method? And how are you trying to debug this?
 
Dinesh sikhwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. You have to drop the newInstance(); from the line 47
2. Remove dbName from this (DriverManager.getConnection(url + dbName, userName, passwort); ) because getConnection function takes only (URL,userName, Password)
3. create a main method in this class and make a call to the function that you want to debug....

Hope that helps you....

thanks
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Dinesh.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic