非你解决不可了!!!!!!数据库是在192.168.180.21上安装的oracle for linux,jBuilder安装在自己机器上,一段代码有如下问题
try {
Class.forName( "oracle.jdbc.xa.client.OracleXADataSource ");
Conn = DriverManager.getConnection( "jdbc:oracle:thin:@//192.168.180.21:1521/orcl1 ", "system ", "neusoft " );
Statement Stmt = Conn.createStatement();
ResultSet RS = Stmt.executeQuery( "SELECT * from users ");
while (RS.next()) {
out.println(RS.getString( "userid ")+ "\t "
+RS.getString( "passwd ")
+ "\t "+RS.getString( "name "));
}
RS.close();
Stmt.close();
Conn.close();
}catch (Exception E) {
System.err.println( "Unable to load driver. ");
E.printStackTrace();
}
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
这段代码有错误:
Unable to load driver.
java.lang.ClassNotFoundException: oracle.jdbc.xa.client.OracleXADataSource
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at simpleservlet.Servlet1.service(Servlet1.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:536)
数据库是在192.168.180.21上安装的oracle for linux,jBuilder for windows安装在自己机器上,在192.168.180.21和自己的机器上都安装了weblogic并且都已经连接192.168.180.21的oracle for linux成功,一段代码有如下问题
[解决办法]
Unable to load driver.
java.lang.ClassNotFoundException: oracle.jdbc.xa.client.OracleXADataSource
相应的数据库驱动类库没找到
[解决办法]
我的oracle for linux是安装在远端的机器上的,
是否需要在本机上安装一个?
[解决办法]
( "oracle.jdbc.xa.client.OracleXADataSource ");没找到这个的jar包,看看你的构建路径,导没导oracle的jar包? 建议用( "oracle.jdbc.driver.OracleDriver ")这个更好
[解决办法]
为什么要都安WEBLOGIC啊 是不是驱动放错地方了啊
[解决办法]
最后还要用到weblogic连接池,所以得安装weblogic,小弟是初学者噢
[解决办法]
WEB-INF\lib 是否有连ORACLE的JAR文件和连接池的JAR文件
[解决办法]
是不是要在我的这一端安装oracle for windows?
[解决办法]
不要的,就是你做的项目里WEB-INF\lib文件夹下是不是有驱动ORACLE需要的JAR文件 当然我也只是猜
[解决办法]
不懂不装懂
帮顶