45865

Where do you put the Oracle's JDBC Thin Driver for Crystal Reports?

Question:

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:

<blockquote>

C:\TEMP>java oracle.jdbc.OracleDriver

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

</blockquote>

So I know it is there.

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: On my computer it is here:

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

Answer1:

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.

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.

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.

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.

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.

Recommend

  • Upload image and information from textfields in the same servlet
  • Cannot find class org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguratio
  • Execute Success but num_rows return 0 [PHP-MySQL]
  • How to export MS Access table into a csv file in Python using e.g. pypyodbc
  • Beginner in SQLite
  • Displaying Data From Multiple MySQL Tables
  • creating instance of object using reflection , when the constructor takes an array of strings as arg
  • Converting query results into DataFrame in python
  • Authentication failed with Azure Active Directory in Windows Phone
  • Creating Java object from class name with constructor, which contains parameters [duplicate]
  • How to Cache Real-time Data?
  • How to use RequestBodyAdvice
  • how to adjust image in a panel in Java swing?
  • Why value captured by reference in lambda is broken? [duplicate]
  • Spring Data JPA custom method causing PropertyReferenceException
  • Array.prototype.includes - not transformed with babel
  • req.body is undefined - nodejs
  • Possible to stop flickering java tooltip in heavyweight mode?
  • output of program is not same as passed argument
  • javascript inside java/jsp code
  • sending/ receiving email in Java
  • Akka Routing: Reply's send to router ends up as dead letters
  • AT Commands to Send SMS not working in Windows 8.1
  • Cannot Parse HTML Data Using Android / JSOUP
  • How to delete a row from a dynamic generate table using jquery?
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • Android Studio and gradle
  • Proper way to use connect-multiparty with express.js?
  • Java static initializers and reflection
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • apache spark aggregate function using min value
  • unknown Exception android
  • EntityFramework adding new object to nested object collection
  • Checking variable from a different class in C#
  • Sorting a 2D array using the second column C++
  • Observable and ngFor in Angular 2
  • How can i traverse a binary tree from right to left in java?
  • failed to connect to specific WiFi in android programmatically
  • Unable to use reactive element in my shiny app
  • How can I use threading to 'tick' a timer to be accessed by other threads?