•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 429,970 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,598 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1105 | Replies: 4 | Solved
![]() |
Hey, so I get a Driver error when I try to connect to my local mysql db. My code is in a servlet as follows
Thanks
M
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con=null;
Statement smt=null;
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/sql?user=webusr&password=pass");M
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,476
Reputation:
Rep Power: 11
Solved Threads: 298
I don't know what is the purpose if that port number over there?
I posted small part of code which I usualy use in other thread http://www.daniweb.com/techtalkforums/post316412-2.html
so you can have look and compare it with your one
I posted small part of code which I usualy use in other thread http://www.daniweb.com/techtalkforums/post316412-2.html
so you can have look and compare it with your one
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 18
Solved Threads: 199
dump the .newInstance(), it's superfluous.
Without knowing the actual error the cause of the problem will always remain guesswork.
But most likely you either don't have the correct driver or the database doesn't allow you to connect.
Without knowing the actual error the cause of the problem will always remain guesswork.
But most likely you either don't have the correct driver or the database doesn't allow you to connect.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- about VC+MySQL problem:) (C)
- php mysql problem (PHP)
- powerbuilder+mysql (MySQL)
- help!! update mysql problem (MySQL)
- hit another brick wall, mysql :S (PHP)
- PHP + MySQL Problem (PHP)
- installing php and mysql properly (Windows Servers and IIS)
- Port 80 problem (Linux Servers and Apache)
Other Threads in the JSP Forum
- Previous Thread: How to send Email from JSP Page
- Next Thread: jsp code to send values to database



Linear Mode