Date: Wed, 13 Aug 2003 13:24:57 +0200 From: Maria Dolores Moral <yoyes@dif.um.es> To: freebsd-net@freebsd.org Subject: java and mysql on FreeBSD Message-ID: <200308131324.57759.yoyes@dif.um.es>
next in thread | raw e-mail | index | archive | help
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.<init>(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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308131324.57759.yoyes>