SQL Server2000的JDBC驱动程序的DriverClassName是 "com.microsoft.jdbc.sqlserver.SQLServerDriver"
SQL Server2005的JDBC驱动程序的DriverClassName是 "com.microsoft.sqlserver.jdbc.SQLServerDriver"
Tomcat *\conf\context.xml配置
<Resource name="jdbc/pubs" auth="Container" type="javax.sql.DataSource" maxActive="100" maxldle="30" maxWait="10000" username="sa" password="sa" driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver" url="jdbc:microsoft:sqlserver://localhost:1433;tabaseName=webshop" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"/> <ResourceLink global="jdbc/pubs" name="jdbc/pubs" type="javax.sql.DataSource"/>
并web.xml里配置
<resource-ref> <description>DataSource</description> <res-ref-name>jdbc/pubs</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
applicationContext.xml
设置
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:/comp/env/jdbc/pubs"/> </bean>
2、SQL Error: 208, SQLState: 42S02 HBM中catalog scheme的配置问题.
|