Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Security 1224-how-to-control-program how to control program/thread 's access authority£¿

Have Programming Question? Ask it here!
 
 
 


guohualee
how to control program/thread 's access authority£¿
1 Answer(s)      6 years and 2 months ago
Posted in : Security



Advertisement
View Answers

May 20, 2008 at 6:43 PM


Hi

import java.util.*;

public class ThreadAccessExam implements Runnable{
static int ThreadCount = 1;
public void run(){
String s = "This is thread " + ThreadCount++;
Vector<String> vec = new Vector<String>();
vec.addElement(s);
vec.addElement(s);
try{
Thread.sleep(1000);
}
catch(Exception e){}
vec.addElement(s);
System.out.println(vec);

}
public static void main(String[] args){
try{
System.out.println("Display the thread massage here:");
for(int i = 0; i < 8; i++){
(new Thread(new ThreadAccessExam())).start();
try{
Thread.sleep(500);
}
catch(Exception e){
System.out.println(e);
}
}
}
catch(Exception e){
e.printStackTrace();
}
}
private static ThreadLocal<Vector> vectors = new ThreadLocal<Vector>();
public static Vector getVector(){
Vector v = (Vector) vectors.get();
if (v == null){
v = new Vector();
vectors.set(v);
}
return v;
}
private static Hashtable<Thread,Vector> vector = new Hashtable<Thread,Vector>();
public static Vector getVectorPriorToJDK12(){
Vector v = (Vector) vector.get(Thread.currentThread());
if(v == null){
v = new Vector();
vector.put(Thread.currentThread(), v);
}
return v;
}
}


---------------------------------------------------------

Read for more information.

http://www.roseindia.net/java/


Related Tutorials/Questions & Answers:
how to control program/thread 's access authority - Security
how to control program/thread 's access authority£¿  how to control program/thread 's access authority like program can't change I/O and change...(){ String s = "This is thread " + ThreadCount++; Vector vec = new
How to access the "Add/Remove Programs" list in Control Panel using Java Program? - Java Beginners
How to access the "Add/Remove Programs" list in Control Panel using Java Program?  Dear Sir, I'm very interested in creating java programs... Programs list in the Control Panel. I don't know, how can i access it? Kindly give me
Advertisements
How to Access MS Access in jar.
How to Access MS Access in jar.  how do i access my Ms-Access file... to access it via Code or is their any alter-native?? Do i need any Driver to do this ... i m able to access a Ms-access via JDBC but cant find the file wen
MySQL Access Control
MySQL Access Control       MySQL Security Access Control Most users concentrate on MySQL's databases... - and they don't usually look deeper to understand how it handles access privileges
How to access Subclass?
How to access Subclass?  How to access subclass in java? please tell me the syntex with an example
How to take control of diffrent system or computer
How to take control of diffrent system or computer  I want to connect to different computers and want have full control remotely. How can java help me in this?   Hello Shubhangam For implementing Remote access client
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
In Struts 2 how to pass the <s: property value=''
In Struts 2 how to pass the s: property value'  In Struts 2 how to pass the s: property value' I have page where i display the list of treasury... this data.jsp from that DB and display the same in a page. How do i send
how to design control panel for web applications
how to design control panel for web applications  how to design control panel for web applications
j2me- how to subtract time s in j2me???
j2me- how to subtract time s in j2me???  hello everyone!! Am a final... with the coding part!! **i want to know as to how exactly to subtract time or time zones?? like if i want to find the time of America being in india... how
how to access database in applet
how to access database in applet  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local system(same network)... but when its in the server, we r getting null values
How to forward the control from one jsp to another?
How to forward the control from one jsp to another?  Hi! This is Prasad Jandrajupalli. I have the 3 JSP's, but I want communicate with each... is not communicate with the Third JSP. I want forward the control from first jsp to second
how to access the details - Java Beginners
how to access the details  how to access the detailsclass E { String name; String no;string place; E(String n,String n,String p.... Please write the program
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
How to convert java BigDecimal to normal byte array not 2 s complement
How to convert java BigDecimal to normal byte array not 2 s complement  How to convert java BigDecimal to normal byte array not 2 s complement
How to use JTable with MS-Access
How to use JTable with MS-Access   I have Three Column in Database (MS-Access). 1. Name 2. City 3. Contact I want to Display this data in JTable. How can I do it. I also want to EDIT and DELETE this Data
How to use JTable with MS-Access
How to use JTable with MS-Access   I have Three Column in Database (MS-Access). 1. Name 2. City 3. Contact I want to Display this data in JTable. How can I do it. I also want to EDIT and DELETE this Data
how to insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
How to access Enterprise Beans
How to access Enterprise Beans In this tutorial you will learn that how to access Enterprise Beans (applicable only to session beans not to message-driven... to clients. Using this view enterprise bean implemented class's or any super
Scroller control in Flex4
:Scroller>. The scrollbars control's the viewport's horizontal and vertical... see how we can use a Scroller control in Flex4. Output: Running...Scroller component in Flex4: The Scroller control is the Spark component
How to access session values through Ajax?
How to access session values through Ajax?  Suppose in a servlet a variable userName is kept in session. How can I access this variable from JSP through AJAX? Is it possible
how to access windows registry information using java?
how to access windows registry information using java?  can any one help me how to access windows registry information using java
How to use Arraylist object in <s:dobleselect> .... struts 2? - Struts
How to use Arraylist object in .... struts 2?  Hi Members, I saw the example of tag in roseindia, its very useful. But I have to use my ArrayList object with that tag. Im retrieving the values for arraylist object from
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before....   Hello Friend, Follow these steps: 1)Go to the start<<Control
How to access the Title tag from xml to jsp
How to access the Title tag from xml to jsp  How to access the Title tag from xml to jsp   Please visit the following link: http://www.roseindia.net/jsp/parsing-xml.shtml The above link will provide you an example
How to make session control using only JSP programming language
How to make session control using only JSP programming language  Could i do Controlling session using only JSP programming language without using anylanguage
How to access (MySQL)database from J2ME?
How to access (MySQL)database from J2ME?  I am new to J2ME. I am using NetBeans. Can anyone help me? How to access (MySQL)database from J2ME? ( I search a lot I found that there is need to access database through servlet
how to access JQuery array in jsp page?
how to access JQuery array in jsp page?  JQury Array: var elems =this.value; var arr = jQuery.makeArray(elems); How to get in jsp page
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to use web services to access hardware units ?
how to use web services to access hardware units ?  Hi I am suresh raja i am doing a project on electronic meter i have to get meter reading with the help of web services and store it to database is it possible to do ! please
How to access Widows" Add/Remove Programs List"? - Java Beginners
How to access Widows" Add/Remove Programs List"?  Dear Friends, How to access the Windows' Add/Remove Program List? Is there any special jar.../developer_guide/control_panel.html
How to access the following tag from xml to jsp
How to access the following tag from xml to jsp  How can i get the title where cat="1" and "My Title" from XML File?   Please visit the following link: http://www.roseindia.net/jsp/parsing-xml.shtml The above link
how to access javascript in mozilla - Java Beginners
how to access javascript in mozilla  i have written javascript code in .js file and i am calling that file in .jsp file as but the script is working in IE but not working in Mozilla. can u plz solve my problem  
access
access   This is Nitha Sriram i am having a problem that, i am having a combo box in the JSP page when i select an item from that i am calling the onchange function. In javascript i am getting the value now i want to pass
How to access session value using OGNL.
How to access session value using OGNL. In this example, you will see how to access value of session using OGNL expression language in struts2.  1-index.jsp <html> <head> <title>Access_Value_bean_from
How to find MAC(Hardware address) address of access point
How to find MAC(Hardware address) address of access point  How can i find out MAC address of Access Point using java
How To Connect MS ACCESS 2003 Database in C Program with Graphics.
How To Connect MS ACCESS 2003 Database in C Program with Graphics.  How To Connect MS ACCESS 2003 Database in C Program with Graphics
How to access sub class member using super class object
How to access sub class member using super class object  class A{ } class B extends A{ int b=1; } class Test{ public static void main(String args[]) { what to do here to access sub class variable b using super class object
How to access Contacts from gmail using LDAP in JSP dropdown list
How to access Contacts from gmail using LDAP in JSP dropdown list  HI, I am creating a JSP page in which i have to make a dropdown box, and access gmail contacts in that drop downlist using LDAP. Can any one plz help me out
How to add tabs in right side of a window from top to bottom in swing s
How to add tabs in right side of a window from top to bottom in swing s  How to add tabs in right side of a window from top to bottom in swings
How to add tabs in right side of a window from top to bottom in swing s
How to add tabs in right side of a window from top to bottom in swing s  How to add tabs in right side of a window from top to bottom in swings
how to send emails to many using jsp by connecting to ms access dabase.
how to send emails to many using jsp by connecting to ms access dabase.  Hi. I am trying to send multiple emails and the email ids are stored in a table in a msaccess database.I am using jsp for this.And finally there should
How to Store Float Value into Access Database - Java Beginners
How to Store Float Value into Access Database  Hello sir,I want to Store Student Marks Percentage into Access Database in Float Value how i can Store.... To store the double value in Access database, you need to set the datatype
How to save JCombobox Selected Item in to Access Database - Java Beginners
How to save JCombobox Selected Item in to Access Database  How to save JCombobox Selected Item in to Access Database  Hi Friend, Try...:access","",""); Statement stmt=con.createStatement(); ResultSet rs
How to store JComboBox selected Item into Ms Access Database - Java Beginners
How to store JComboBox selected Item into Ms Access Database  How to store JComboBox selected Item into Ms Access Database.  Hi Friend...:access","",""); Statement stmt=con.createStatement(); ResultSet rs
how to connect java with ms access using odbc in eclipse
how to connect java with ms access using odbc in eclipse  import java.sql.*; class AccessDatabase{ public static void main(String[] args... Access Driver (*.accdb)};DBQ=student.accdb","",""); Connection con
Struts control data flow
Struts control data flow  How Struts control data flow
How To Display MS Access Table into Swing JTable - Java Beginners
How To Display MS Access Table into Swing JTable  How to Display Records From MS Access Database To JTable. Plz Help Me  Hi Friend... = DriverManager.getConnection("jdbc:odbc:access"); String sql = "Select * from
how to access element added via javascript dynamically using jsp code
how to access element added via javascript dynamically using jsp code  Urgent..Anyone please Assist how to access data from the elements added via... not able to access these dynamically added textboxes values from my jsp code
 

 

 

DMCA.com