Mysql and java on FreeBSD
Maria Dolores Moral
yoyes at dif.um.es
Tue Aug 12 06:49:45 PDT 2003
Hello.
I am working with java and mysql on FreeBSD.
I have read that I need use:
Class.forName("com.mysql.jdbc.Driver");
connect= DriverManager.getConnection("jdbc:mysql://localhost:3306/db_name");
But when I do not how compile:
javac -classpath ??? Program.java
I think I must use mysql-jdbc-mm, but I have an error when I compile.
I do not if I need it as jdbc or I need add something to the path.
If somebody have had a similar error, please help me.
Thanks a lot. Yours faithfully
You can see the error here:
***********************************
localhost# pwd
/usr/ports/databases/mysql-jdbc-mm
localhost# make NO_CHECKSUM=yes
===> Building for mysql-jdbc-mm-2.0.14
Buildfile: build.xml
clean:
[delete] Deleting 49 files from
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14
init:
[delete] Deleting directory
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build
[copy] Copying 65 files to
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14
[copy] Copied 1 empty directory to
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14
[copy] Copying 3 files to
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14
compile-core:
[javac] Compiling 23 source files
[javac] Note: 2 files use or override a deprecated API. Recompile with
"-deprecation" for details.
[javac] 1 warning
compile-jdbc1:
compile-jdbc2:
[javac] Compiling 16 source files
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlDataSourceFactory.java:28:
Package javax.naming not found in import.
[javac] import javax.naming.*;
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlDataSourceFactory.java:29:
Class javax.naming.spi.ObjectFactory not found in import.
[javac] import javax.naming.spi.ObjectFactory;
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlDataSourceFactory.java:35:
Interface javax.naming.spi.ObjectFactory of class
org.gjt.mm.mysql.jdbc2.optional.MysqlDataSourceFactory not found.
[javac] public class MysqlDataSourceFactory implements ObjectFactory
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlDataSource.java:30:
Package javax.naming not found in import.
[javac] import javax.naming.*;
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlDataSource.java:37:
Interface org.gjt.mm.mysql.jdbc2.optional.Referenceable of class
org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource not found.
[javac] public class MysqlDataSource implements DataSource, Referenceable,
Serializable
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlXaDataSourceFactory.java:28:
Package javax.naming not found in import.
[javac] import javax.naming.*;
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlXaDataSourceFactory.java:29:
Class javax.naming.spi.ObjectFactory not found in import.
[javac] import javax.naming.spi.ObjectFactory;
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlXaDataSourceFactory.java:35:
Interface javax.naming.spi.ObjectFactory of class
org.gjt.mm.mysql.jdbc2.optional.MysqlXaDataSourceFactory not found.
[javac] public class MysqlXaDataSourceFactory implements ObjectFactory
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlXaDataSource.java:30:
Package javax.naming not found in import.
[javac] import javax.naming.*;
[javac] ^
[javac]
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/optional/MysqlXaDataSource.java:43:
Interface org.gjt.mm.mysql.jdbc2.optional.Referenceable of class
org.gjt.mm.mysql.jdbc2.optional.MysqlXaDataSource not found.
[javac] Referenceable,
[javac] ^
[javac] Note:
/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build/mm.mysql-2.0.14/org/gjt/mm/mysql/jdbc2/Connection.java
uses or overrides a deprecated API. Recompile with "-deprecation" for
details.
[javac] 10 errors, 1 warning
BUILD FAILED
file:/usr/ports/databases/mysql-jdbc-mm/work/mm.mysql-2.0.14/build.xml:75:
Compile failed; see the compiler error output for details.
Total time: 31 seconds
*** Error code 1
Stop in /usr/ports/databases/mysql-jdbc-mm.
***********************************
More information about the freebsd-net
mailing list