添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

java.lang.SecurityException: Prohibited package name: java.sql

521236 Feb 9 2009 — edited Feb 11 2009
Hi!
I have got an applet, but I get the next exception in the java console, when I want to display it:
java.lang.SecurityException: Prohibited package name: java.sql
Maybe I have to set permission for applet in the JRE policy file? I tried it, but no success...
grant {
permission java.security.AllPermission;
Thank for Your help!
This is my code:
package com.nextent;
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import oracle.forms.properties.ID;
import oracle.forms.ui.VBean;
import oracle.sql.CLOB;
import com.nextent.helpers.ExcelLoadingHelper;
public class ExcelLoading extends VBean {
public static final ID FILEPATH = ID.registerProperty("filepath");
public static final ID NOTEFORFILE = ID.registerProperty("noteforfile");
public static final ID FILELOADERTYPEID = ID.registerProperty("fileloadertypeid");
public static final ID FILELOADERITEMID = ID.registerProperty("fileloaderitemid");
private static String filePath;
private static String noteForFile;
private static long idFileLoaderType;
private Connection conn;
private String idLog;
/* *************************************************************
* ********************** main method **************************
* ************************************************************/
public synchronized Integer saveExcelXml(String path,
String note,
long idFileLoaderType) throws SQLException, IOException {
try {
log("START ExcelLoading","");
idLog = null;
Integer id = null;
String sql = "BEGIN " +
"INSERT INTO extracts.file_loader_item " +
"(name,note,file_loader_type_id,status_id,file_content,file_size,file_rows) VALUES " +
"(?,?,?,484600510,?,?,?) RETURNING id INTO ?; " +
"END;";
// 484600510 = AKTIV
//PreparedStatement ps = conn.prepareStatement(sql);
CallableStatement cs = getConn().prepareCall(sql);
FileInputStream fis = new FileInputStream(path);
CLOB clob = ExcelLoadingHelper.createClob(fis, getConn());
cs.setString(1, path);
cs.setString(2, note);
cs.setLong(3, idFileLoaderType);
cs.setClob(4, clob);
cs.setLong(5, clob.length());
long rowCnt = ExcelLoadingHelper.occurenceInFile(clob, "<Row>", path.substring(path.lastIndexOf(".")+1));
cs.setLong(6, rowCnt);
cs.registerOutParameter(7, java.sql.Types.NUMERIC);
cs.execute();
conn.commit();
id = new Integer(cs.getInt(7));
cs.close();
return id;
catch(Exception e) {
conn.rollback();
try {
log("ERROR ExcelLoading", ""+e);
catch (Exception e1) {
System.out.println(e1);
return null;
finally {
try {
log("END ExcelLoading","");
catch (Exception e) {
System.out.println(e);
conn.close();
/ *************************************************************
* *************** for ORACLE VBean method *********************
* ************************************************************/
public boolean setProperty(ID id, Object value) {
try {
if (id == FILEPATH) {
filePath = (String)value;
if (id == NOTEFORFILE) {
//noteForFile = (String)value;
if (id == FILELOADERTYPEID) {
idFileLoaderType = ((Integer)value).longValue();
boolean flag = super.setProperty(id, value);
return flag;
catch(Exception e) {
try {
log("ERROR ExcelLoading", ""+e);
} catch (Exception e1) {
System.out.println("Hiba az ERROR üzenet mentése során! "+e1);
e.printStackTrace();
boolean flag = false;
return flag;
public Object getProperty(ID id) {
try {
if (id == FILELOADERITEMID) {
Integer i = saveExcelXml(filePath,noteForFile,idFileLoaderType);
return i;
catch(Exception e) {
e.printStackTrace();
return null;