With terminal I have :
CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/:/Library/Java/Extensions/:./
SUDO_GID=20
SECURITYSESSIONID=210800
_=/usr/bin/printenv
127:/Library/WebServer/Documents/Java root# java TestMySQL
2006-05-21 13:39:00.0 ************************** = OK
127:/Library/WebServer/Documents/Java root#
with
| import java.sql.*;
| /**
| * mysql-connector-java-3.1.12-bin.jar
| *
| */
| /**
| * % javac /Library/WebServer/Documents/Java/TestMySQL.java
| * % java -classpath
/usr/local/lib/mysql/mysql-connector-java-3.1.12-bin.jar:. TestMySQL
| */
| public class TestMySQL {
|
|
| public static void main(String argv[]) throws Exception {
|
| // Load the driver class
| //
| Class.forName("org.gjt.mm.mysql.Driver");
|
| //Class theClass = null;
| //try {
| // theClass =
Thread.currentThread().getContextClassLoader().loadClass("org.gjt.mm.mysql.Driver");
| //}
| //catch (ClassNotFoundException e) {
| // theClass =
getClass().getClassLoader().loadClass("org.gjt.mm.mysql.Driver");
| //}
| Connection conn = DriverManager.getConnection(
| "jdbc:mysql:///test",
| "",
| ""
| );
| Statement stmt = conn.createStatement();
| ResultSet rset = stmt.executeQuery("SELECT now();");
| while (rset.next()) {
| System.out.println(rset.getString(1));
| }
|
| // Close result set, statement and DB connection
| //
| rset.close();
| stmt.close();
| conn.close();
| }
| }
|
I have a simple TestMySQL.html file with applet TestMySQL.class in it.
Nothing but "Applet TestMySQL not inited"
When I uncomment the try/catch lines, java compiler generate an error...
With "Class.forName("org.gjt.mm.mysql.Driver");" no problem.
Running MacOS X 10.3.9, Apache/1.3.33 (Darwin) PHP/4.4.1 mod_ssl/2.8.24
OpenSSL/0.9.7i and JVM 1.4.2_09
Thanks for help.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3945149#3945149
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3945149
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user