기술지원 문의
리눅스에서 apache+resin+msyl ?
나그네 / 2002-03-19 00:00
안녕하세요...
윈두우에서는 잘되는데...mysql 과 연동이
꼭 리눅스에서는 안돼네요....mysql 과 연동이
/etc/profile 입니다
PATH=$PATH:/usr/java/j2sdk1.4.0/bin
export JAVA_HOME=/usr/java/j2sdk1.4.0
export CLASSPATH=./:$JAVA_HOME/lib/mm.mysql-2.0.4-bin.jar
이렇게 해주었습니다..
jsdk는 최신 1.4 버전이구요...
자꾸 mysql 과 연동이 안된다구 나오네요...
===========
500 Servlet Exception
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at com.caucho.util.DynamicClassLoader.loadClass(DynamicClassLoader.java:479)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at _list._list__jsp._jspService(/list/list.jsp:3)
at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
at com.caucho.jsp.Page.subservice(Page.java:485)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:176)
at com.caucho.server.http.Invocation.service(Invocation.java:278)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:338)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:270)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:536)
--------------------------------------------------------------------------------
Resin 2.0.4 (built Thu Nov 15 17:56:24 PST 2001)
원도우에서는 잘되는데...
부탁좀 드릴께요
JDBC 연동 확인 해보세요.
운영자 / 2002-03-19 00:00
아래의 소스로 JDBC 연동 확인 해보세요.
* USERID, PASSWD 부분을 적절하게 수정하세요.
import java.sql.*;
import java.lang.*;
import java.io.*;
// Notice, do not import org.gjt.mm.mysql.*
// or you will have problems!
public class mysqltest
{
public static void main(String argv[]) {
try {
// The newInstance() call is a work around for some
// broken Java implementations
Class.forName(\"org.gjt.mm.mysql.Driver\");
} catch (Exception E) {
System.out.println(\"Unable to load driver.\");
E.printStackTrace();
}
try {
String url = \"jdbc:mysql://localhost:3306/mysql\";
Connection Conn = DriverManager.getConnection(url, \"USERID\", \"PASSWD\");
// Do something with the Connection
// Use some connection weve already created
//System.out.println(\"Connection Established !!! \");
Statement Stmt = Conn.createStatement();
ResultSet RS = Stmt.executeQuery(\"SELECT Host, User from user\");
System.out.println(\"Got result:\");
while (RS.next()) {
String Host= RS.getString(1);
String User = RS.getString(2);
System.out.println(\" HOST = \" + Host);
System.out.println(\" USER= \"+ User);
// System.out.println(RS.getString(1));
} // end while()
// Clean up after ourselves
RS.close();
Stmt.close();
Conn.close();
} catch (SQLException E) {
System.out.println(\"SQLException: \" + E.getMessage());
System.out.println(\"SQLState: \" + E.getSQLState());
System.out.println(\"VendorError: \" + E.getErrorCode());
}
} // end of main()
} // end of class()