0
首先感谢我的英语,这是我的第二语言。netbeans tomcat jt400链接数据库
我试图从websphere服务器移动到tomcat 8服务器。 除了与数据库的连接,每件事情都很好。
我期待在不同的地方,据我了解,我必须修改的context.xml 但我不断收到此日志形式的tomcat:
第一部分平移“问题而宣告池”
[BDD ERROR] Probl?me lors de la d?claration du pool:无法创建资源实例
这里是context.xml和我用来纪念数据库的类。
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/CGR_Server" reloadable="true">
<Resource auth="Container"
name="java:comp/env/jdbc/OLA"
type="javax.sql.DataSource"
driverClassName="com.ibm.as400.access.AS400JDBCConnectionPoolDataSource"
url="jdbc:as400://OLA;naming=system;errors=full;"
username="XXXX"
password="XXXX"
maxIdle="10"
maxActive="200"
maxWait="5"
removeAbandoned="true"
removeAbandonedTimeout="1200"
/>
</Context>
的方法连接到AS400
public boolean open(){
DataSource source=null;
try {
source= (DataSource) new InitialContext().lookup(pools[as400]);
connection = source.getConnection();
if (connection == null){
return false;
}else{
connection.setAutoCommit(autoCommit);
if(scroll){
stmt=connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
}else{
stmt=connection.createStatement();
}
}
} catch (NamingException e) {
traitementErreur(e);
return false;
} catch (SQLException e) {
traitementErreur(e);
return false;
} catch (Exception e) {
traitementErreur(e);
return false;
}
return true;
}