- I have gone to 'Add Library', selected 'User Library', defined a User Library called jTDS and imported the jtds-1.2.5.jar file into the User Library. I assume that the newly-christened 'jTDS' library is included in the build path as my only option when right-clicking on it is to remove it from the build-path.
- Unit tests for the DefaultProperties class. Driver: jTDS implementation of the java.sql.Driver interface. DriverUnitTest: Unit tests for the Driver class. DriverUnitTest.TestDrivergetPropertyInfo: Class used to test Driver.getPropertyInfo(String, Properties).
- Cannot Load Jdbc Driver Class Net.sourceforge.jtds.jdbc.driver
- Cannot Load Jdbc Driver Class 'net.sourceforge.jtds.jdbc.driver' Jmeter
![Net Net](https://i.stack.imgur.com/Zvp7U.jpg)
Age of mythology rotate camera. If you think you added the jar, you could check if this driver class (net.sourceforge.jtds.jdbc.Driver) actually is inside the jar – Tom Jun 19 '12 at 13:41 show 1 more comment 0.
Cannot Load Jdbc Driver Class Net.sourceforge.jtds.jdbc.driver
- ⋅100分求《新手学HTML+CSS》的光盘内容
- ⋅运行时错误1004 类worksheet的paste方法无效
- ⋅去掉xml里的非法字符问题
![Jdbc Jdbc](https://1.bp.blogspot.com/-TVXzNt2Nylo/WHzDdinJySI/AAAAAAAAAn0/x7Z0AHjoLmsQeD028GBNvJ00o5NiHvIEACLcB/s1600/SQL%2BLoad%2BTesting.png)
![Cannot load jdbc driver class Cannot load jdbc driver class](https://s3.manualzz.com/store/data/030782727_1-6565140c73996482dd16724f153c4aad.png)
Cannot Load Jdbc Driver Class 'net.sourceforge.jtds.jdbc.driver' Jmeter
等级
结帖率 100%
把数据库连接写在jsp中能访问数据库,但写在server.xml中tomcat启动时错误为:
[ksystem] DEBUG [main] ClickstreamListener.<init>(28) | ClickstreamLogger constr
ucted
[ksystem] ERROR [main] JDBCExceptionReporter.logExceptions(46) | Cannot load JDB
C driver class 'null'
[ksystem] ERROR [main] JDBCExceptionReporter.logExceptions(46) | Cannot load JDB
C driver class 'null'
Cannot load JDBC driver class 'null'
java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:523)。。。。。
server.xml的配置为:
<Realm className='org.apache.catalina.realm.JDBCRealm' debug='99'
driverName='net.sourceforge.jtds.jdbc.Driver'
connectionURL='jdbc:jtds:sqlserver://localhost/shtzdb;charset=gb2312;autoReconnect=true'
connectionName='sa' connectionPassword='sa'
userTable='tb_sys_user' userNameCol='user_code' userCredCol='password'
userRoleTable='tb_sys_user_role' roleNameCol='role_code' />
<Resource name='jdbc/ksystem' auth='Container' type='javax.sql.DataSource'/>
<ResourceParams name='jdbc/ksystem'>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!-- MySQL dB username and password for dB connections -->
<parameter>
<name>username</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value>sa</value>
</parameter>
<!-- Class name for JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>net.sourceforge.jtds.jdbc.Driver</value>
</parameter>
<!-- Autocommit setting. This setting is required to make
Hibernate work. Or you can remove calls to commit(). -->
<parameter>
<name>defaultAutoCommit</name>
<value>true</value>
</parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
<parameter>
<name>url</name>
<value>jdbc:jtds:sqlserver://localhost/shtzdb;charset=gb2312;autoReconnect=true</value>
</parameter>
<!-- Recover abandoned connections -->
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<!-- Set the number of seconds a dB connection has been idle
before it is considered abandoned.
-->
<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<!-- Log a stack trace of the code which abandoned the dB
connection resources.
-->
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams>
[ksystem] DEBUG [main] ClickstreamListener.<init>(28) | ClickstreamLogger constr
ucted
[ksystem] ERROR [main] JDBCExceptionReporter.logExceptions(46) | Cannot load JDB
C driver class 'null'
[ksystem] ERROR [main] JDBCExceptionReporter.logExceptions(46) | Cannot load JDB
C driver class 'null'
Cannot load JDBC driver class 'null'
java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:523)。。。。。
server.xml的配置为:
<Realm className='org.apache.catalina.realm.JDBCRealm' debug='99'
driverName='net.sourceforge.jtds.jdbc.Driver'
connectionURL='jdbc:jtds:sqlserver://localhost/shtzdb;charset=gb2312;autoReconnect=true'
connectionName='sa' connectionPassword='sa'
userTable='tb_sys_user' userNameCol='user_code' userCredCol='password'
userRoleTable='tb_sys_user_role' roleNameCol='role_code' />
<Resource name='jdbc/ksystem' auth='Container' type='javax.sql.DataSource'/>
<ResourceParams name='jdbc/ksystem'>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!-- MySQL dB username and password for dB connections -->
<parameter>
<name>username</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value>sa</value>
</parameter>
<!-- Class name for JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>net.sourceforge.jtds.jdbc.Driver</value>
</parameter>
<!-- Autocommit setting. This setting is required to make
Hibernate work. Or you can remove calls to commit(). -->
<parameter>
<name>defaultAutoCommit</name>
<value>true</value>
</parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
<parameter>
<name>url</name>
<value>jdbc:jtds:sqlserver://localhost/shtzdb;charset=gb2312;autoReconnect=true</value>
</parameter>
<!-- Recover abandoned connections -->
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<!-- Set the number of seconds a dB connection has been idle
before it is considered abandoned.
-->
<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<!-- Log a stack trace of the code which abandoned the dB
connection resources.
-->
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams>
只看楼主引用举报楼主收起
![](https://cdn-ak.f.st-hatena.com/images/fotolife/r/ruriatunifoefec/20200910/20200910011327.png)