请问这是什么错误啊?请大家帮我看看

04-08-16 xwqwell

我连oracle对的,可是连sybase就报错误,请大家帮我看看

主要是实现新的ResultSet

package com.servlet;

import java.sql.*;

import javax.sql.*;

import javax.naming.*;

import java.util.*;

import javax.rmi.*;

import com.bean.Pageable;

import com.bean.PageableResultSet2;

/* 其中 public interface Pageable extends java.sql.ResultSet

public class PageableResultSet2 implements Pageable

代码就不贴了

*/

public class testconn {

public static void main(String[] args) {

DataSource ds = null ;

Context ctx = null;

Connection myConn = null;

try {

ctx = getInitialContext();

ds = (javax.sql.DataSource)ctx.lookup("shopDS");// sybase

//ds = (javax.sql.DataSource)ctx.lookup ("testTxDataSource"); //oracle

}

catch (Exception E){

System.out.println("Init Error :"+E);

}

PreparedStatement pstmt = null;

Statement stmt = null ;

Pageable myResult = null ;

try {

myConn = ds.getConnection();

pstmt = myConn.prepareStatement("Select * from tcategory",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);

myResult = new PageableResultSet2(pstmt.executeQuery());

myResult.setPageSize(3);//每页2个记录

myResult.gotoPage(3);//跳转到第2页

/* while (myResult.next()){

System.out.println("CateName:" + myResult.getString("CateName"));

}*/

for(int i=0; i<myResult.getPageRowsCount(); i++){//循环处理

System.out.println("CateName : "+myResult.getString("CateName"));

}

myResult.close();

}

catch (SQLException e){

System.out.println("Error code = "+ e.getErrorCode());

System.out.println("Error message = "+ e.getMessage());

}

finally {

try {

if (pstmt != null){

pstmt.close();

}

if(myConn != null) {

myConn.close();

}

}

catch (SQLException e){

System.out.println("Error code = "+ e.getErrorCode());

System.out.println("Error message = "+ e.getMessage());

}

}

}

private static Context getInitialContext() throws Exception{

String url = "t3://10.10.3.62:7001";

//String user = "sa";

//String password = null;

Properties properties = null;

try {

properties = new Properties();

properties.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

properties.put(Context.PROVIDER_URL,url);

//if(user != null){

// properties.put(Context.SECURITY_PRINCIPAL,user);

// properties.put(Context.SECURITY_CREDENTIALS, password == null ? "":password);

// }

return new InitialContext(properties);

}

catch (Exception e){

throw e;

}

}

}

我连oracle对的,可是连sybase就报以下错误,请大家帮我看看

Error code = 0

Error message = weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:

[java.rmi.ServerError: A error occurred the server; nested exception is:

java.lang.AbstractMethodError

Start server side stack trace:

java.rmi.ServerError: A error occurred the server; nested exception is:

java.lang.AbstractMethodError

at weblogic.rmi.internal.BasicServerRef.handleThrowable(BasicServerRef.java:565)

at weblogic.rmi.internal.BasicServerRef.postInvoke(BasicServerRef.java:533)

at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:411)

at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:251)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:219)

Caused by: java.lang.AbstractMethodError

at weblogic.jdbc.common.internal.ConnectionEnv.getStatementHolderForCachedPrepared(ConnectionEnv.java:482)

at weblogic.jdbc.pool.Connection.prepareStatement(Connection.java:487)

at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:431)

at weblogic.jdbc.rmi.internal.ConnectionImpl_WLSkel.invoke(Unknown Source)

at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:455)

at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:396)

at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:726)

at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:391)

... 3 more

End server side stack trace

; nested exception is:

java.lang.AbstractMethodError:

Start server side stack trace:

java.lang.AbstractMethodError

at weblogic.jdbc.common.internal.ConnectionEnv.getStatementHolderForCachedPrepared(ConnectionEnv.java:482)

at weblogic.jdbc.pool.Connection.prepareStatement(Connection.java:487)

at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:431)

at weblogic.jdbc.rmi.internal.ConnectionImpl_WLSkel.invoke(Unknown Source)

at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:455)

at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:396)

at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:726)

at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:391)

at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:251)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:219)

End server side stack trace

]