|
Java学习者论坛
error : Error accessing jdbc driver: driverURL = jdbc:weblogic:pool:MSSQL Server Connection Pool, props = {connectionPoolID=MSSQL Server Connection Pool, jdbcTxDataSource=true, enableTwoPhaseCommit=true}
Start server side stack trace:
java.sql.SQLException: Error accessing jdbc driver: driverURL = jdbc:weblogic:pool:MSSQL Server Connection Pool, props = {connectionPoolID=MSSQL Server Connection Pool, jdbcTxDataSource=true, enableTwoPhaseCommit=true}
at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:326)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:380)
at weblogic.jdbc.jts.Driver.connect(Driver.java:132)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:265)
at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:359)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:762)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
End server side stack trace
程序如下:
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
try
{
Context ctx = new InitialContext(ht);
DataSource ds = (DataSource)ctx.lookup("MyServer");
Connection con = ds.getConnection();
Statement st = con.createStatement();
ResultSet res = st.executeQuery("select * from employees");
Huan迎來到Java学习者lun坛,转載请注明地址:http://www.javaxxz.com. |
|