请问:java.security.AccessControlException是什么错?

imtiger 2003-09-26 09:34:33
在thinging in java第二版的jdbc章节中有个程序VLookup,可是我在本机试运行时总是报错
java.security.AccessControlException
我查了一下是在
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");这句出的错,请问是什么原因?
...全文
47 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
powerman_lyj 2003-10-27
  • 打赏
  • 举报
回复
提供客户端的操作界面和一些接收数据规范化显示和输入数据的一般校验
okwuzhijun 2003-10-27
  • 打赏
  • 举报
回复
做些本地处理,减小服务器的压力
imtiger 2003-10-27
  • 打赏
  • 举报
回复
那么网页中下载到客户端的applet有什么用呢?
telenths 2003-09-27
  • 打赏
  • 举报
回复
你是要访问本地数据库啊
那肯定是不行的了

Applet 只能访问 他所在的 服务器的资源
imtiger 2003-09-27
  • 打赏
  • 举报
回复
没有啊,是不是applet不能访问本地的数据库
cnpr 2003-09-26
  • 打赏
  • 举报
回复
http://www.eaoo.com/design/list.asp?classid=2&Nclassid=14
Trace File Manager (TFM) - Using PHP and Oracle to manage your distributed trace files--------------------------------------------------------------------------------------Deployment InstructionsOracle Layer The Oracle JServer must be installed and exist in a valid state. Ensure that the directories specified in the parameters for USER_DUMP_DEST and BACKGROUND_DUMP_DEST are set up as utl_file_dir directives in the init.ora, eg utl_file_dir=myDB/oratrace/back utl_file_dir=myDB/oratrace/user Run all of the below mentioned scripts in any database whose trace files you want to view As SYS create a user account (TFMADMIN) See - tfmadmin_create.sql This account will be the repository for all of the Oracle objects used by the utility and will be responsible for retrieving information from the file system for presentation to the PHP layer. nb ! The supplied create script is for demo purposes only. You will need to specify a password and you may also want to assign alternative default and temporary tablespaces. create the external library call Windows - see extWindows.sql Linux - see extLinux.sql nb ! for unix it would be ; create or replace library systemcalls is ‘/lib/libc.so‘; / grant necessary database privileges to tfmadmin tfmAdmin_privs_and_syns.sql grant necessary java privileges to tfmadmin tfmAdmin_java_privs.sql if this fails with any spurious dbms_java errors then issue the statements manually, eg exec dbms_java.grant_permission (‘TFMADMIN‘, ‘SYS:java.io.FilePermission‘,‘your background_dump_dest‘, ‘read‘) exec dbms_java.grant_permission (‘TFMADMIN‘, ‘SYS:java.io.FilePermission‘,‘your user_dump_dest‘, ‘read‘) create a wrapper package for utl_file pk_utl_file.sql As TFMADMIN set up the tables, views and sequence tfmadmin_objects.sql create the controlling package pack_trace_file_manager.sqlJava Layer TraceFileDisplay.java you need to compile this and use loadjava to deploy it into the TFMADMIN account sample compilation & load - see javacomp.txt test the Java layer - RECOMMENDED I have seen occasions where the java security layer behaves unpredictably and this can result in the Trace File Display utility falsely reporting that there are no trace files in the trace directories. consequently it is a sensible idea to verify that your java layer is behaving as expected before you try starting up the utility as TFMADMIN, try this exec pack_trace_file_manager.pc_generate_file_list (‘BACKGROUND‘) if you get a "PL/SQL procedure completed successfully" then everything is OK if you get something like this ... * ERROR at line 1: ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: th (java.io.FilePermission D:OCCdboratraceack read) has not been granted to TFMADMIN. The PL/SQL to dbms_java.grant_permission( ‘TFMADMIN‘, ‘SYS:java.io.FilePermission‘, ‘D:OCCdboratraceack‘, ‘rea ORA-06512: at "TFMADMIN.PACK_TRACE_FILE_DISPLAY", line 45 ORA-06512: at "TFMADMIN.PACK_TRACE_FILE_DISPLAY", line 135 ORA-06512: at line 1 then you will need to sort it out before you go any further. Firstly, check out Note:137280.1 on Metalink. If the error persists beyond the solution suggested here then try; as SYS grant JAVASYSPRIV, JAVAUSERPRIV to tfmadmin; If this does not help then you can always adopt the "Mit Kanonen auf Spatzen schie遝n" approach (Shooting sparrows with canons ...) ; exec dbms_java.grant_permission (‘TFMADMIN‘, ‘SYS:java.io.FilePermission‘,‘<>‘, ‘read‘); If that doesn‘t work then raise it with Oracle Support - there may well be a fundamental problem with your java layer.Apahe / PHP layer If you haven‘t already done so, deploy Apache and PHP in a centralised location. see http://otn.oracle.com/tech/opensource/php/apache/inst_php_apache_windows.html for a handy guide to deployment source code ; listTargets.php listFiles.php * retrieveTraceFile.php * tkprofDialog.php deleteFilesConfirmation.php * you may need to either remove or edit the YourDomain tag in here I found the easist way to make the oci connection work from a php source file was to specify the full connection string as it would appear in the tnsnames.ora - In our environment this included a domain name - what you do will depend on your personal environment ... configuration files user.conf - contains the username & password for db connections made to the TFMADMIN account from the php layer - edit as required targets.conf - contains a list of the connection details for the databases where TFMADMIN is deployed - edit as required cascading stylesheet - not supplied
Eclipse 是目前功能比较强大的JAVA IDE(JAVA编程软件),是一个集成工具的开放平台,而这些工具主要是一些开源工具软件。在一个开源模式下运作,并遵照共同的公共条款,Eclipse 平台为工具软件开发者提供工具开发的灵活性和控制自己软件的技术。 Eclipse已经围绕着免版权费技术和通用平台,为工具集成开发形成了一个独立的开放的“生态系统”。以Eclipse为基础的工具允许开发者自由选择语言,平台和厂商环境。 Eclipse提供了一个以插件为基础的框架,让你可以轻松创建,集成和使用工具软件,节省了大量时间和金钱。通过合作和一体化开发核心技术,软件工具开发者可以利用平台的重复使用功能,专注于核心技术,创建新的开发技术。 JBuilder, Eclipse, Neebeans 是3种应用比较普遍的Java开发的平台,如果你以后想走java这条路,最好学会EcLIPSE。jcreator功能太简单,不好用,JBUILDER太庞大,不好学。查看Eclipse快捷键指南。 Eclipse的平台是基于Java语言编写,并包含大量的插件创建工具以及实例。它已经在大范围的开发工作站上应用,包括Linux,HP-UX,AIX,Solaris,QNX,Mac OS X,以及Windows平台的系统。 "分享一个在Java中反射获取私有构造函数、属性、方法" 我一直以为类的私有构造函数、属性、方法除了类自身其他类是无法访问的,前几天正好学习Spring框架,在学习Spring框架基础 Bean包时,写了一个简单的例子,类似如下:   package study.spring.bean;    public class SimpleBean   {   private String beanName;   private SimpleBean() {   System.out.println( " SimpleBean " );   }   /** */ /**   * @return Returns the beanName.   */   public String getBeanName()   {   return beanName;   }   /** */ /**   * @param beanName The beanName to set.   */   public void setBeanName(String beanName)   {   this .beanName = beanName;   }   }   发现居然也能调用成功,当时很惊讶,反射机制平时在以前的项目中也常使用,但不能构造只有私有构造函数的类。   自己做了一个简单例子:   package study.spring.bean;   import java.lang.reflect.Constructor;   import java.lang.reflect.InvocationTargetException;   public class SimpleTest   {   /** *//**   * @param args   */   public static void main(String[] args)   {   // TODO Auto-generated method stub   try   {    Constructor[] cts=Class.forName("study.spring.bean.SimpleBean").getDeclaredConstructors();   for(int i=0;i<cts.length;i++){    cts[i].newInstance(null);   }   }   catch (SecurityException e)   {   // TODO Auto-generated catch block   e.printStackTrace();   }   catch (ClassNotFoundException e)   {   // TODO Auto-generated catch block   e.printStackTrace();   }   catch (IllegalArgumentException e)   {   // TODO Auto-generated catch block   e.printStackTrace();   }   catch (InstantiationException e)   {   // TODO Auto-generated catch block   

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧