标题: 请教在WebLogic中设置Sybase数据库的Connection Pool [打印本页] 作者: nobody1086 时间: 2003-01-16 13:42 标题: 请教在WebLogic中设置Sybase数据库的Connection Pool 我在自己地程序中使用Sybase的JDBC驱动连接数据库成功,程序见下,但是使用同样的url和driver名字,在Weblogic中设置Connection Pool时,出现下面错误:
<2003-1-16 下午01时13分58秒>; <Error>; <JDBC>; <001060>; <Cannot startup connection
pool "sybasepool" weblogic.common.ResourceException: java.sql.SQLException: JZ0S
J: 没有在此数据库中发现元数据存取器信息。
at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
at com.sybase.jdbc.MdaManager.loadMetaData(MdaManager.java)
at com.sybase.jdbc.MdaManager.<init>;(MdaManager.java)
at com.sybase.jdbc.MdaManager.<init>;(MdaManager.java)
at com.sybase.jdbc.SybConnection.checkMDA(SybConnection.java)
at com.sybase.jdbc.SybConnection.getMDA(SybConnection.java)
at com.sybase.tds.Tds.getIntOption(Tds.java)
at com.sybase.jdbc.SybConnection.getTransactionIsolation(SybConnection.j
ava)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:141)
at weblogic.jdbc.common.internal.ResourceAllocator.makeResources(Resourc
eAllocator.java:929)
运行正常的测试程序:
import java.sql.*;
import java.util.*;
public class TestSybase{
public static void main(String args[]){
Connection con = null;
String sqlstr = new String();
Properties info = new Properties();
ResultSet rs;
info.put("user", "iss"
info.put("password", "sybase"
try{
/* Load the class */
Class.forName("com.sybase.jdbc.SybDriver".newInstance();
System.out.println("JDBC driver loaded."
/* Establish the connection to the database */
con = DriverManager.getConnection("jdbc:sybase:Tds:10.4.5.250:8080",info);
System.out.println("Database connection established."
/* Create a statement for later usage */
Statement stmt = con.createStatement();
/* Get the data from the table */
String myStr = new String();
myStr.getBytes("ISO8859_1"
sqlstr = "select * from test";
rs = stmt.executeQuery(sqlstr);
while (rs.next()) {
System.out.println("tram :" + rs.getString("tram");
}
}
catch (ClassNotFoundException cnfe){
System.out.println("ClassNotFoundException: Could not locate driver."
}
catch (SQLException cnfe){
System.out.println("******************************** SQLException **********************************"
System.out.println("SQL State: " + cnfe.getSQLState());
System.out.println("Message : " + cnfe.getMessage());
System.out.println("SQL Code : " + cnfe.getErrorCode());
System.out.println("********************************************************************************"
//System.out.println("SQLException: " + cnfe);
}
catch (Exception e){
System.out.println("An unknown error occurred while connecting to the database ");
}
finally {
try{
if (con != null )
con.close();
}
catch(SQLException sqle){
System.out.println("Unable to close database connection.");
}
}
}
}作者: nobody1086 时间: 2003-01-16 13:44 标题: 请教在WebLogic中设置Sybase数据库的Connection Pool Weblogic中URL:jdbc:sybase:Tds:10.4.5.250:8080
DriverName:com.sybase.jdbc.SybDriver
Properities: user=sa
password=