Hi, I am trying to run a java program as an NT service that connects to an Oracle DB using a system DSN. When I start the process under a domain user account I am getting the following excetion: ***EXCEPTION[java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) But the surprising fact is that when I do the same using the default SYSTEM account, the program is able to connect to the database and access records. Can someone throw light as to why I get this particular problem? Thanks in advance. Ganapathi [ July 09, 2003: Message edited by: Ganapathi Srinivasan ]
As part of its initialization, the DriverManager class will attempt to load the driver classes referenced in the "jdbc.drivers" system property. This allows a user to customize the JDBC Drivers used by their applications. ** THIS COULD MEAN THAT YOUR jdbc.drivers SYSTEM PROPERTIES DIFFER ON THE TWO DIFFERENT ACCOUNTS YOU'RE USING
For example in your ~/.hotjava/properties file you might specify:
jdbc.drivers=foo.bah.Driver:wombat.sql.Driver:bad.taste.ourDriver A program can also explicitly load JDBC drivers at any time. For example, the my.sql.Driver is loaded with the following statement: Class.forName("my.sql.Driver"); When the method getConnection is called, the DriverManager will attempt to locate a suitable driver from amongst those loaded at initialization and those loaded explicitly using the same classloader as the current applet or application.