Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2002 11:10:39 +0530
From:      "Unix Tools" <unixtools@hotmail.com>
To:        "Liu Siwei" <sw_liu@hotmail.com>, <questions@freebsd.org>
Subject:   Re: help me about jsp connect to mysql
Message-ID:  <OE20karIpX96gabfYAH0000494c@hotmail.com>
References:  <F32b9pPFR6sKBEr8pkp000000ff@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

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

<%
        Class.forName("org.gjt.mm.mysql.Driver");
        Connection dbConn=DriverManager.getConnection("jdbc:mysql://<MYSQL
SERVER IP>/<DATABASENAME>?user=<DATABASE USERNAME>&password=<DATABASE
PASSWORD>");

        Statement stmt=dbConn.createStatement();
        ResultSet rs=stmt.executeQuery("show tables");

        while(rs.next())
        {
                out.println(rs.getString(1));
        }

%>

This will work

Thank You.


----- Original Message -----
From: "Liu Siwei" <sw_liu@hotmail.com>
To: <questions@freebsd.org>
Sent: Tuesday, October 22, 2002 01:33 PM
Subject: help me about jsp connect to mysql


> Hi,all:
> Please help me.
>
> I have installed jdk1.3.1(freebsd native) and Tomcat 4.1.x and mysql323
> from port and put MySQL jdbc driver to /usr/local/jdk1.3.1/jre/lib/ext and
> WEB-INF/lib, but when I use root to connect MySQL from jsp, it says:
>
> Server configuration denies access to data source
>
> why? when i work in MS windows, i have no problem.
>
> how to solve it ?
>
> Best Regard.
>
> _________________________________________________________________
> 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/lccn/
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OE20karIpX96gabfYAH0000494c>