看起来像jdk版本太低了
java.sql
Interface Savepoint
public interface Savepoint
The representation of a savepoint, which is a point within the current transaction that can be referenced from the Connection.rollback method. When a transaction is rolled back to a savepoint all changes made after that savepoint are undone. Savepoints can be either named or unnamed. Unnamed savepoints are identified by an ID generated by the underlying data source. Since:
1.4 java -verison
看看你当前的jdk/jre版本是什么?
java.sql
Interface Savepoint
public interface Savepoint
The representation of a savepoint, which is a point within the current transaction that can be referenced from the Connection.rollback method. When a transaction is rolled back to a savepoint all changes made after that savepoint are undone. Savepoints can be either named or unnamed. Unnamed savepoints are identified by an ID generated by the underlying data source. Since:
1.4 java -verison
看看你当前的jdk/jre版本是什么?
代码如下:
import java.sql.*;
import java.util.*;
public class ConnectOracle
{
Connection conn = null;
public ConnectOracle()
{
try{
DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch ( SQLException se)
{
System.out.println("Register Fail");
}
catch (ClassNotFoundException e)
{
System.out.println("Could not load the driver");
}
System.out.println ("Connecting to the local database");
try{
conn = DriverManager.getConnection("jdbc:oracle:thin:@zengjie:1521:orcl92", "test", "test");
// conn = DriverManager.getConnection("jdbc:oracle:oci:@orcl92", "test", "test");
}
catch(SQLException e){
System.out.println("Connection Fail!");
}
}
void close()
{
try
{
if ( conn != null )
conn.close();
}
catch(SQLException e)
{
}
}
public static void main(String[] args)
{
ConnectOracle o = new ConnectOracle();
o.close();
}
}
如果低的话,请下载1.4以上的jdk
或者找个支持jdk1.3的jdbc driver for oracle9.2也可以(我估计这个比上面的难找)