2014-05-06 60 views
0

我想使用的HA-JDBC与SQL Server 2008年。HA-JDBC cluster.xml看起来像如何配置HA-JDBC SQL Server 2008中

<ha-jdbc xmlns="urn:ha-jdbc:cluster:3.0"> 
<sync id="passive"/> 
<state id="simple"/> 
<cluster balancer="load" 
dialect="standard" default-sync="passive" transaction-mode="parallel" 
durability="none" meta-data-cache="lazy"> 
<database id="db1" location="com.microsoft.sqlserver.jdbc.SQLServerDriver"> 
    <user>user</user> 
    <password>pass</password> 
    <property name="serverName">abc</property> 
    <property name="portNumber">121</property> 
    <property name="databaseName">dbname</property> 
</database> 
<database id="db2" location="com.microsoft.sqlserver.jdbc.SQLServerDriver"> 
    <user></user> 
    <password></password> 
    <property name="serverName"></property> 
    <property name="portNumber"></property> 
    <property name="databaseName"</property> 
</database> 
</cluster> 

</ha-jdbc> 

不知道在发生什么位置标签。这个例外,我得到:

java.sql.SQLException: class com.microsoft.sqlserver.jdbc.SQLServerDriver 
at net.sf.hajdbc.sql.SQLExceptionFactory.createException(SQLExceptionFactory.java:51) 
at net.sf.hajdbc.sql.SQLExceptionFactory.createException(SQLExceptionFactory.java:35) 
at net.sf.hajdbc.AbstractExceptionFactory.createException(AbstractExceptionFactory.java:62) 
at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:95) 
at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:34) 
at net.sf.hajdbc.sql.CommonDataSource.getProxy(CommonDataSource.java:85) 
at net.sf.hajdbc.sql.DataSource.getConnection(DataSource.java:60) 
Caused by: java.lang.ClassCastException: class com.microsoft.sqlserver.jdbc.SQLServerDriver 
at java.lang.Class.asSubclass(Class.java:3126) 
at net.sf.hajdbc.sql.CommonDataSourceDatabase.getConnectionSource(CommonDataSourceDatabase.java:81) 
at net.sf.hajdbc.sql.CommonDataSourceDatabase.getConnectionSource(CommonDataSourceDatabase.java:43) 
at net.sf.hajdbc.sql.DatabaseClusterImpl.isAlive(DatabaseClusterImpl.java:841) 
at net.sf.hajdbc.sql.DatabaseClusterImpl.start(DatabaseClusterImpl.java:715) 
at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:76) 

阅读大量的博客,但找不到任何solution.Any排序指导将非常感激。

回答

0

com.microsoft.sqlserver.jdbc.SQLServerDataSource为我工作。