The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

how can we install MM.MySQL driver

Posted by Nalin Chhabra on March 31, 2001 at 3:26 AM

Hi everybody! I from New Delhi - India. I am developing a portal in JSP with backend MySQL. I struck at one one point very seriously. We have downloaded MM.MySQL driver and JRUN. We are trying to configure these two together with MySQL database. Also we are looking for the Code in Java to connect JSP programmes to MySQL database by using MM.MySQL driver. We have followed the following set of instruction as mentioned below:

<%@ page language="java" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>

<%
try

{

try{
Class.forName("org.gjt.mm.mysql.Driver");
}
catch(Exception e)
{
out.println(e);
}

/*Properties P = System.getProperties();
P.put("jdbc.drivers", "org.gjt.mm.mysql.Driver");
System.setProperties(P);*/


Connection Conn = null;

Conn = DriverManager.getConnection("jdbc:mysql://localhost/dbpaper?user=soumen");

Statement Stmt = Conn.createStatement();

ResultSet rs = Stmt.executeQuery("select * from password");
while (rs.next())
{
out.println(rs.getString("login"));
}
}
catch(Exception e)
{}

%>


But in this code there is some problem occuring. Pl. tell us the necessary updation. How to cofigure/install MM.MySQL driver.

An earlyresponse will be highly appreciated.With thanks.



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us