提交 6b0bc96e authored 作者: Thomas Mueller's avatar Thomas Mueller

The database did not automatically upgrade when using a connection pool or data source.

上级 2aa71513
...@@ -21,6 +21,7 @@ import javax.sql.DataSource; ...@@ -21,6 +21,7 @@ import javax.sql.DataSource;
import javax.sql.PooledConnection; import javax.sql.PooledConnection;
import javax.sql.XAConnection; import javax.sql.XAConnection;
import javax.sql.XADataSource; import javax.sql.XADataSource;
import org.h2.Driver;
import org.h2.jdbc.JdbcConnection; import org.h2.jdbc.JdbcConnection;
import org.h2.message.TraceObject; import org.h2.message.TraceObject;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
...@@ -176,7 +177,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref ...@@ -176,7 +177,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
Properties info = new Properties(); Properties info = new Properties();
info.setProperty("user", user); info.setProperty("user", user);
info.put("password", password); info.put("password", password);
return new JdbcConnection(url, info); return (JdbcConnection) Driver.load().connect(url, info);
} }
/** /**
......
...@@ -19,6 +19,7 @@ import javax.sql.XAConnection; ...@@ -19,6 +19,7 @@ import javax.sql.XAConnection;
import javax.transaction.xa.XAException; import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource; import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid; import javax.transaction.xa.Xid;
import org.h2.Driver;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties; import org.h2.constant.SysProperties;
import org.h2.jdbc.JdbcConnection; import org.h2.jdbc.JdbcConnection;
...@@ -73,7 +74,7 @@ implements XAConnection, XAResource ...@@ -73,7 +74,7 @@ implements XAConnection, XAResource
Properties info = new Properties(); Properties info = new Properties();
info.setProperty("user", user); info.setProperty("user", user);
info.put("password", StringUtils.cloneCharArray(password)); info.put("password", StringUtils.cloneCharArray(password));
physicalConn = new JdbcConnection(url, info); physicalConn = (JdbcConnection) Driver.load().connect(url, info);
} }
//## Java 1.4 end ## //## Java 1.4 end ##
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论