From owner-freebsd-net@FreeBSD.ORG Wed Aug 13 03:47:24 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82E6437B401 for ; Wed, 13 Aug 2003 03:47:24 -0700 (PDT) Received: from unimur.um.es (unimur.um.es [155.54.1.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46C6043F85 for ; Wed, 13 Aug 2003 03:47:23 -0700 (PDT) (envelope-from yoyes@dif.um.es) Received: from aries.dif.um.es (aries.dif.um.es [155.54.210.253]) by unimur.um.es (8.9.1b+Sun/8.9.1) with ESMTP id MAA16373 for ; Wed, 13 Aug 2003 12:21:05 +0200 (MEST) Received: from localhost (gemela.dif.um.es [155.54.210.45]) by aries.dif.um.es (Postfix) with ESMTP id 943F514426 for ; Wed, 13 Aug 2003 12:10:12 +0200 (MET DST) Content-Type: text/plain; charset="us-ascii" From: Maria Dolores Moral To: freebsd-net@freebsd.org Date: Wed, 13 Aug 2003 13:24:57 +0200 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308131324.57759.yoyes@dif.um.es> Subject: java and mysql on FreeBSD X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2003 10:47:24 -0000 Please, if you can help me :-( I do not know anywhere where I can ask this question I am working with java and mysql on FreeBSD 4.7 I have had a lot of problem with the java connection with mysql, but I do= not=20 if a FreeBSD problem or mysql problem ?? When I compile my java program I obtain: localhost# ./Server Exception: java.sql.SQLException: Server configuration denies access to d= ata=20 source java.sql.SQLException: Server configuration denies access to data source at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:399) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562) at com.mysql.jdbc.Connection.(Connection.java:491) at=20 com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346= ) at java.sql.DriverManager.getConnection(DriverManager.java:450) at java.sql.DriverManager.getConnection(DriverManager.java:130) at Server.obtainPK(Server.java:45) at Server.main(Server.java:145) I use for compiling: javac -classpath=20 /usr/ports/databases/mysql-java-3.0.8/mysql-connector-java-3.0.8-stable-b= in.jar:.=20 Server.java java -classpath=20 /usr/ports/databases/mysql-java-3.0.8/mysql-connector-java-3.0.8-stable-b= in.jar:.=20 Server /*************************************** And my program is: /**********************/ /* Server.java */ /**********************/ import java.io.*; import java.lang.*; import java.net.*; import java.util.*; import org.gjt.mm.mysql.Driver; import java.sql.*; public static void main(String[] args) throws IOException{ ... try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); Connection con =3D=20 DriverManager.getConnection("jdbc:mysql://localhost/Server:3306","testuse= r",""); } catch (Exception E) { System.err.println("Unable to load driver."); E.printStackTrace(); } ... } /*************************************** But whe I execute mysql I can see the database and the table. You can see it: localhost# mysql -u testuser -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 to server version: 3.23.52 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use Server Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +------------------+ | Tables_in_Server | +------------------+ | Certificate | +------------------+ 1 row in set (0.00 sec) Thanks a lot