public static void updateSqlOracle(String sqlstr,String linkIP,String username,String password) throws SQLException, ClassNotFoundException{ Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@"+linkIP+":1521:GVDB";// 设置连接字符串 GVDB为实例名 linkIP为连接地址 Connection con=java.sql.DriverManager.getConnection(url,username,password); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(sqlstr); rs.close(); stmt.close(); con.close(); }