本文介绍了您在哪里将Oracle的JDBC Thin驱动程序用于Crystal Reports?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您在哪里保存用于Oracle的jdbc thin驱动程序?我试过 jre / lib / ext 但我的程序,水晶报告不断说它找不到它。

Where do you save the jdbc thin driver for Oracle? I have tried jre/lib/ext but my program, Crystal Reports keeps saying it can't find it. I figure I have saved it in the wrong place.

如果我访问命令提示符并使用:

If I go to a command prompt and use:

Oracle 11.2.0.3.0使用JDK6在Fri_Aug_26_08上编译的JDBC 4.0:19 :15_PDT_2011

默认连接属性资源

2011年7月12日星期三14:02:05

Oracle 11.2.0.3.0 JDBC 4.0 compiled with JDK6 on Fri_Aug_26_08:19:15_PDT_2011
Default Connection Properties Resource
Wed Oct 12 14:02:05 EDT 2011

所以我知道它是在那里。

So I know it is there.

编辑:因为我无法获得CR的工作,我试过一个控制台应用程序,但是找不到驱动程序:

edit: Since I could not get CR to work I tried a console app but it cannot find the driver:

package javaapplication1;


public class JavaApplication1 {

 public static void main (String[] args) throws Exception
  {
   Class.forName ("oracle.jdbc.OracleDriver");

   Connection conn = DriverManager.getConnection
     ("jdbc:oracle:thin:@myserver:1521:mysid", "myid", "mypass");
                        // @//machineName:port/SID,   userid,  password
   try {
     Statement stmt = conn.createStatement();
     try {
       ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
       try {
         while (rset.next())
           System.out.println (rset.getString(1));   // Print col 1
       }
       finally {
          try { rset.close(); } catch (Exception ignore) {}
       }
     }
     finally {
       try { stmt.close(); } catch (Exception ignore) {}
     }
   }
   finally {
     try { conn.close(); } catch (Exception ignore) {}
   }
  }
}

edit:在我的电脑上,它在这里:

edit: On my computer it is here:

C:\Program Files \SAP BusinessObjects \SAP BusinessObjects Enterprise XI 4.0 \win32_x86 \jdk\\ \\ jre \lib \ext

C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\jdk\jre\lib\ext

推荐答案

只需将其放在应用程序的运行时类路径中。由类路径共享的文件系统路径取决于您如何执行应用程序。

Just put it in the application's runtime classpath. The file system paths covererd by the classpath depends on how you're executing the application.

根据您的问题历史记录,我看到您使用的是JSP / Servlets因此意味着它是一个在应用程序服务器中运行的WAR文件的Web应用程序。在这种情况下,JAR文件需要进入webapp自己的 / WEB-INF / lib 文件夹或者在appserver自己的 / lib 文件夹。

Based on your question history I see that you're using JSP/Servlets, which thus means that it's a web application in flavor of a WAR file which runs in an appserver. In that case, the JAR file needs to go in webapp's own /WEB-INF/lib folder or in the appserver's own /lib folder.

如果它是一个普通的Java应用程序 .class c> main()方法执行 java 命令,那么你必须使用 cp -classpath )参数指定运行时类路径。它需要一个(半)冒号分隔的磁盘文件系统路径的集合。

If it were a plain vanilla Java application .class file with a main() method which is to be executed by java command, then you'd have to use the -cp (-classpath) argument to specify the runtime classpath. It takes a collection of (semi)colon separated disk file system paths.

如果是JAR文件,则必须在JAR的 Class-Path code> /META-INF/MANIFEST.MF 文件。这可以是相对于 java -jar 命令的工作目录。

If it were a JAR file, then it had to be specified in the Class-Path entry in JAR's /META-INF/MANIFEST.MF file. This can be relative to the java -jar command's working directory.

你应该避免将第三方库JRE的 / lib 文件夹。这将潜在地与使用相同JRE的所有其他现有应用程序引入类路径问题。

You should really avoid putting 3rd party libraries in JRE's /lib folder. This would potentially introduce classpath problems with all other existing applications which use the same JRE.

这篇关于您在哪里将Oracle的JDBC Thin驱动程序用于Crystal Reports?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 17:24