User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 426,629 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 1,594 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

jsp and mysql

Join Date: Feb 2006
Posts: 1,460
Reputation: masijade is just really nice masijade is just really nice masijade is just really nice masijade is just really nice masijade is just really nice 
Rep Power: 9
Solved Threads: 131
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: jsp and mysql

  #4  
Oct 4th, 2007
Originally Posted by nikhita View Post
<%

Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url="jdbc:mysql://localhost/database_name?user=user_name&password=type_password&useUnicode=true&characterEncoding=8859_1";
Connection conn= DriverManager.getConnection(url);

Statement stmt=conn.createStatement();
.
.
.
.
%>
like that it goes.........

Hop it will help u.......


That is the old MySQL driver, and is only still present in the distribution for backwards compatability. Use, as the first reply indicated, com.mysql.jdbc.Driver instead of org.gjt.mm.mysql.Driver

Edit: Also, remove all of that scriptlet stuff out of that JSP. It does not belon there. Put it into a bean or some other external object. Anywhere but as a scriptlet in the JSP.

Edit Again:

And DAMN, I didn't notice that this was some ancient post reanimated every two years.

nikhita. The OP made the post four years ago. And the last reply before yours (and mine, unfortunately) was two years ago. I don't think anybody is waiting on an answer anymore.
Last edited by masijade : Oct 4th, 2007 at 8:05 am. Reason: additional info. marked above
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
All times are GMT -4. The time now is 12:34 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC