日期:2014-05-18  浏览次数:20794 次

非你解决不可了!!!!!!数据库是在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(Con