Exception opening database connection

hello sir,

i am unable to connect to database thru JDBCRealm.

my my_app_name.xml file(located under C:\Tomcat\conf\Catalina\localhost )

<?xml version='1.0' encoding='utf-8'?>

<Context crossContext="true" displayName="Hello, World Application" docBase="ContentDashBoard" path="/ContentDashBoard" workDir="work\Catalina\localhost\ContentDashBoard">

<Realm className="org.apache.catalina.realm.JDBCRealm" connectionName="sa" connectionPassword="iso*help" connectionURL="jdbc:microsoft:sqlserver://localhost:1433;databasename=dname;SelectMethod=cursor" debug="7" digest="MD5" driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver" roleNameCol="role_name" userCredCol="password" userNameCol="user_id" userRoleTable="cd_user_role" userTable="cd_user"/>

</Context>

i am getting the following errro when i run the jsp file

JDBCRealm[/my_app_name]: Exception opening database connection

java.sql.SQLException: com.microsoft.jdbc.sqlserver.SQLServerDriver

at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:589)

at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:663)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4244)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)

at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)

at org.apache.commons.digester.Rule.end(Rule.java:276)

at org.apache.commons.digester.Digester.endElement(Digester.java:1058)

at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)

at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.commons.digester.Digester.parse(Digester.java:1567)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)

at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

[4644 byte] By [Annamalaii1a] at [2007-10-3 4:33:20]
# 1
And what happens when you use that connection string in a stand alone app - one that has nothing to do with a J2EE container?
jschella at 2007-7-14 22:36:56 > top of Java-index,Core,Core APIs...
# 2

i am really dont understand why JDBCRealm is not working, eben though all the setup done correctly.

Its throwing the exception Exception opening database connection.

java.sql.SQLException: com.microsoft.jdbc.sqlserver.SQLServerDriver

Plz provide me the help

regards

venki

Annamalaii1a at 2007-7-14 22:36:56 > top of Java-index,Core,Core APIs...
# 3
What part of my previous response (question) did you not understand?
jschella at 2007-7-14 22:36:56 > top of Java-index,Core,Core APIs...
# 4
> eben though all the setup done correctly. What makes you think that? You're getting this error message that (to me) strongly suggests that Tomcat can't find that class. To me that says you haven't done the part of the setup where you put that class where Tomcat can find it.
DrClapa at 2007-7-14 22:36:56 > top of Java-index,Core,Core APIs...