找不到JDBC驱动程序类:oracle.jdbc.OracleDriver [英] JDBC Driver class not found: oracle.jdbc.OracleDriver
问题描述
我已经安装了第三方Java Web服务,该服务使用Oralce jdbc瘦驱动程序将数据写入Oracle数据库.运行此命令时,出现以下错误;
I have installed a third party java webservice which uses Oralce jdbc thin driver to write data into Oracle database. When i run this, i get the following error;
JDBC驱动程序类:oracle.jdbc.OracleDriver
我已经安装了oracle,并将classpath变量设置为以下值:
I have oracle installed and set classpath variable to following value:
* D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ classes12.jar; D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ classes12.zip; D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ ojdbc14.jar; D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ ojdbc14.zip; C:\ Program Files \ Java \ jdk1.7.0 \ jre \ lib \ rt.jar *
*D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.zip;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip;C:\Program Files\Java\jdk1.7.0\jre\lib\rt.jar*
和路径变量为以下值;
and path variable to following value;
* D:\ oracle \ product \ 10.2.0 \ client_1 \ bin; C:\ Program Files \ Java \ jdk1.7.0 \ bin \; D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ classes12.jar; D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ classes12.zip; D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ ojdbc14.jar; D:\ oracle \ product \ 10.2.0 \ client_1 \ jdbc \ lib \ ojdbc14.zip *
*D:\oracle\product\10.2.0\client_1\bin;C:\Program Files\Java\jdk1.7.0\bin\;D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.zip;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip*
关于Web服务为何无法识别jdbc驱动程序的任何建议?
Any suggestion why web service is not able to identify jdbc driver?
谢谢
推荐答案
我知道将Java应用程序转换为Windows服务的两种方法,并且都不使用CLASSPATH
.一种是由Tanuki Software开发的 Java Service Wrapper .此工具使用wrapper.conf
,您可以在其中显示具有.jar
库的目录:
I know 2 ways of turning Java app into Windows service and both do not use CLASSPATH
. One is Java Service Wrapper by Tanuki Software. This tool uses wrapper.conf
where you can show directories with .jar
libraries:
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=c:\jars\*
wrapper.java.classpath.2=myservice.jar
我知道的第二个工具是 JSL:Java服务启动器.在此工具中,您将jsl.ini
放在命令行中以运行服务器.它可以将Java与-cp
选项一起使用以显示.jar
库的位置:
Second tool I know is JSL: Java Service Launcher. In this tool there is jsl.ini
where you put command line to run your server. It can use java with -cp
option to show location of .jar
libraries:
[defines]
MY_LIBS=d:\jars\*
AXIS_LIBS=d:\axis2-1.5.4\lib\*
CLASSPATH=.;%MY_LIBS%;%AXIS_LIBS%
export = CLASSPATH
...
[java]
...
cmdline = -Dfile.encoding=utf8 -cp %CLASSPATH% example.my.server
在两种配置中,您都可以使用*
添加所有.jar
文件,也可以一一显示这些文件(就像在CLASSPATH
中一样).
In both configuration you can use *
to add all .jar
files or you can show those files one by one (just like in CLASSPATH
).
首先,您应该知道Windows试图执行什么.在服务属性页面中进行检查.然后尝试本地化其配置.如果它使用我知道的一种工具,那么您就知道要更改什么.其他工具可能具有类似的配置.
At first you should know what Windows is trying to execute. Check it in the service properties page. Then try to localize its configuration. If it uses one of tools I know then you know what to change. Other tools probably have similar configuration.
这篇关于找不到JDBC驱动程序类:oracle.jdbc.OracleDriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!