0

I just want to ask for some help regarding the JDBC driver and configuring a ColdFusion datasource. After I save, by clicking the submit button, it generates this error:

Connection verification failed for data source: mydtsrcName java.sql.SQLException: No suitable driver found for jdbc:jtds:sybase://127.0.0.1:1313/test.db The root cause was that: java.sql.SQLException: No suitable driver found for jdbc:jtds:sybase://127.0.0.1:1313/test.db

Can anyone explain the problem? How can I install the JDBC driver in ColdFusion?

Here are the settings for the DSN that I configured in the ColdFusion Administrator:

 CF Data Source : my_dtsrc
 JDBC URL       : jdbc:sybase:Tds:127.0.0.1:3939
 Driver Class   : com.sybase.jdbc3.jdbc.SybDriver
 Driver Name    : SybDriver
 User name      : myusername
 Password       : mypwd

Did I miss something ?

Leigh
  • 28,765
  • 10
  • 55
  • 103
mathiascolebar
  • 199
  • 3
  • 10
  • 6
    The error message is pretty clear. CF cannot find the driver. 1) Did you add the driver jar to the CF class path **and** restart the CF server first? 2) Please update your question to show us the settings you entered for the DSN (driver class, jdbc url, etcetera). – Leigh Nov 03 '13 at 15:00
  • @Leigh, I am confuse where to put .jar in the directory ? – mathiascolebar Nov 05 '13 at 18:40

1 Answers1

1

(Extended from comments ...)

Did you add the driver jar to the CF class path and restart the CF server first? When the CF server starts, it only checks specific locations for jars/classes. Collectively, those locations are referred to as the "CF class path". Your driver jar must be placed somewhere within the CF class path, or it will not be detected. Hence the error message "No suitable driver found".

There are several locations CF checks automatically when it starts, such as:

  • {cf_root}\lib
  • {cf_root}\WEB-INF\lib

The simplest option is to just drop your jar in one of those directories. Then restart the service so CF detects the jar. Afterward, CF will be able to locate the driver class and you can create your "Other" datasource. (Note, the driver class name is case-sensitive)

NB: Technically you can place a jar anywhere, as long as it is accessible to the CF server and you add it to the class path in jvm.config. (See this blog entry for details. It is old, but still relevant). But again, it is simpler to just drop it in one of the directories CF checks automatically. Then there is no need to muck around with the jvm.config file.

Community
  • 1
  • 1
Leigh
  • 28,765
  • 10
  • 55
  • 103
  • Hi @Leigh, thank you for the quick reply...before i was not able to find where to see the class path to be configure,but it is in the Java and JVM, thank you for the links it's working now.:) – mathiascolebar Nov 05 '13 at 19:28
  • Welcome. Keep in mind you do not need to change the class path if you just drop the jar in `{cf_root}\WEB-INF\lib`. But either way is fine. – Leigh Nov 05 '13 at 19:34