Speed at which JAVA programs are executed

While it is true that a typical JAVA program will execute slower than an equivalent program written in other languages such as C++.
Is it because the compiled bytecodes (.class) have to be interpreted by the JVM?
Thanks.

yep, a .class is bytecode... the JVM interprets the bytecode "on the fly".
The JVM's major task is to "interpolate" native operating system requests. That's why the JVM is platform specific.
The bytecode to native interpretation takes a few clock ticks, so it's a might slower than native compiled code... but it's practically important to realise that this is not the big performance hit inherent in a "Virtual Machine"... the big (potential) performance loss is the overhead of "interpolating" every single O/S interface request... hence String BufferedReader.readLine() is light-years faster than char InputStream.read(), because .read() has to (1) interpret your request, (2) set the registers, (3) do an operating system interupt, (3) interpret the response... for EVERY SINGLE EENY WEENY CHARACTER... which in practice means you can't do an usable java port of directX... which is a shame really.
But is does mean that you can (almost) write a webapp which is completely portable across platforms (with zero code change).
horses....
keith.
Message was edited by:
corlettk

Similar Messages

  • Which Java program do I use for this game?

    Okay, I'm programming a video game for my High School grad project.
    Now, I'm just wondering, which Java program do I use for it? It will be 2-d, I'd like it to have SNES like graphics, and it will be a platformer, but kind of like Metroid. You will be able to change forms, from ice to water to a gaseous state, and you have different powers according to which form you're in, like forming an ice bridge in ice form, slipping through cracks in water form, and rising higher in a gaseous form.
    Thank you for your help.

    no, not if you did not code java before.
    There are IDEs like Eclipse arround but that are not good at beginning because they are quite complex and don't take away the coding.
    lg Clemens

  • How to find out Which SAP programs are affecting Which Z programs?

    Do we have a program/tool that can tell us the following:
    How to find out Which SAP programs are affecting Which Z programs in the entire development server?  
    We have a list of SAP programs and a list of custom u2018zu2019 programs, which ones impact each other?   I know we have a u201Cwhere usedu201D functionality, however that is at the object by object level. 
    We need are looking for something a little larger u2013
    thanks in advance
    Vishnu

    Do we have a program/tool that can tell us the following:
    How to find out Which SAP programs are affecting Which Z programs in the entire development server?  
    We have a list of SAP programs and a list of custom u2018zu2019 programs, which ones impact each other?   I know we have a u201Cwhere usedu201D functionality, however that is at the object by object level. 
    We need are looking for something a little larger u2013
    thanks in advance
    Vishnu

  • Which java applets are used for..........................

    hi,
    i want to ask that which java applets are used for receving sms on website.?????????????????????????
    or how can we receive sms on website by using which java applets? or tell me any other method for doing this task.
    thanx in advanced

    Hi,
    For general ledger :
    http://help.sap.com/saphelp_nw70/helpdata/en/57/dd153c4eb5d82ce10000000a114084/frameset.htm
    This is the best how-to guide on AP,AR,GL and TAX.
    http://help.sap.com/saphelp_nw04/helpdata/en/af/16533bbb15b762e10000000a114084/frameset.htm
    Hope it helps.
    Regards,
    Srikanth.

  • Disallow java program to execute external command

    How to disallow java program to execute some external command.
    Thank.

    It work by using custom policy, thank
    Test.java
            String command1[] = {"/bin/ls","-a,","-l"};
            String command2[] = {"/bin/pwd"};
            Runtime runtime = Runtime.getRuntime();
            try{
                Process p1 = runtime.exec(command1);
                Process p2 = runtime.exec(command2); // AccessControlException: access denied
                Scanner s1 = new Scanner(p1.getInputStream());
                Scanner s2 = new Scanner(p2.getInputStream()); 
                System.out.println(s1.nextLine());
                System.out.println(s2.nextLine()); 
            }catch(Exception ex){
               ex.printStackTrace();
            }java.policy
    grant{
       permission java.io.FilePermission "/bin/ls", "execute";
    }Run
    $java -Djava.security.manager -Djava.security.policy=java.policy Test
    java.security.AccessControlException: access denied (java.io.FilePermission /bin/pwd execute)

  • Java program are limited as Administrator after windows 7 update

    I have updated the windows 7.
    The java program(packaged by InstallAnywhere 2008 Enterprise) can be executed when I login the system as ordinary user.
    but the error will occur when I execute the java program as Administrator,please refer to the below error information.
    (The java program can be executed correctly before the windows 7 update, so I think there maybe some new restriction for the java if login as Administrator )
    >>It fails to install with this error msg.
    >>
    >>java.lang.NoClassDefFoundError: Could not initialize class ZeroGah
    >> at com.zerog.ia.installer.LifeCycleManager.a(DashoA8113)
    >> at com.zerog.ia.installer.LifeCycleManager.g(DashoA8113)
    >> at com.zerog.ia.installer.LifeCycleManager.h(DashoA8113)
    >> at com.zerog.ia.installer.LifeCycleManager.a(DashoA8113)
    >> at com.zerog.ia.installer.Main.main(DashoA8113)
    >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    >> at java.lang.reflect.Method.invoke(Unknown Source)
    >> at com.zerog.lax.LAX.launch(DashoA8113)
    >> at com.zerog.lax.LAX.main(DashoA8113)
    *************************************************************************************************

    The only thing that I can see here is that some installer is failing; this is not the place to ask for support with that installer.

  • How to write a JAVA program to execute the SQL queries

    I have a database in the Microsoft Access queries and I need to execute the query by some how write the Java program to make it execute the query. because I need to get the different of time so I know how fast each query run.
    Thank you

    You need jdbc-driver for MSAccess for run this example:
    JDBCClient.java
    import java.util.Properties;
    import java.lang.String;
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.BufferedOutputStream;
    import java.lang.System;
    import java.lang.Class;
    import java.sql.SQLException;
    import java.util.Date;
    import java.util.Locale;
    import java.text.DateFormat;
    import java.sql.Time;
    public class JDBCClient{
        private String DriverName = new String();
        private String DatabaseURL = new String();
        private String UserName = new String();
        private String Password = new String();
        private String SQLFile = new String();
        private String OutputFile = new String();
        private String Separator = new String();
        private boolean NeedColumnHeaders;
        private String EncodingParamName = new String();
        private String EncodingValue = new String();
        private String OutputEncoding = new String();
        private boolean AfterLastColumnSeparator;
        JDBCClient( String propfilename){
         System.out.println( "Initializing...");
         Properties properties = new Properties();
         try{
             properties.load( new FileInputStream( propfilename));
         catch( Exception e){
                 System.out.println( "Error: " + e.toString());
             System.exit( 0);
         DriverName = properties.getProperty( "DriverName");
         DatabaseURL = properties.getProperty( "DatabaseURL");
         UserName = properties.getProperty( "UserName");
         Password = properties.getProperty( "Password");
         SQLFile = properties.getProperty( "SQLFile");
         OutputFile = properties.getProperty( "OutputFile");
         Separator = properties.getProperty( "Separator");
         if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "yes") == 0 ||
             properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "true") == 0)
             NeedColumnHeaders = true;
         else
         if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "no") == 0 ||
             properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "false") == 0)
             NeedColumnHeaders = false;
         else{
                 System.out.println( "Invalid value for \"NeedColumnHeaders\" property (logical expected)");
             System.exit( 0);
         EncodingParamName = properties.getProperty( "EncodingParamName");
         EncodingValue = properties.getProperty( "EncodingValue");
         OutputEncoding = properties.getProperty( "OutputEncoding");
         if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "yes") == 0 ||
             properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "true") == 0)
             AfterLastColumnSeparator = true;
         else
         if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "no") == 0 ||
             properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "false") == 0)
             AfterLastColumnSeparator = false;
         else{
                 System.out.println( "Invalid value for \"AfterLastColumnSeparator\" property (logical expected)");
             System.exit( 0);
         try{
             byte[] EOL = new byte[2];
             EOL[0] = 13;
             EOL[1] = 10;
             Class.forName( DriverName);
             Properties connInfo = new Properties();
             connInfo.put( "user", UserName);
             connInfo.put( "password", Password);
             if( EncodingParamName.length() != 0 && EncodingValue.length() != 0)
              connInfo.put( EncodingParamName, EncodingValue);
                 Connection connection = DriverManager.getConnection( DatabaseURL, connInfo);
             FileInputStream in = new FileInputStream( SQLFile);
             byte[] buffer = new byte[in.available()];
             in.read( buffer);
             in.close();
             String SQL = new String( buffer);
                 PreparedStatement statement = connection.prepareStatement( SQL);
             Date d1 = new Date();
                 System.out.println( "Database connected at " + d1 + " Executing statement...");
                ResultSet resultSet = null;
             if( statement.execute())
              resultSet = statement.getResultSet();
             else{
                  System.out.println( "Script updates " + statement.getUpdateCount() + " records.");
              System.exit( 0);
                 ResultSetMetaData metaData = resultSet.getMetaData();
                 BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( OutputFile));
             if( NeedColumnHeaders && metaData.getColumnCount() > 0){
              String head = new String();
              for( int i = 1; i < metaData.getColumnCount(); i++)
                  head += metaData.getColumnName( i) + Separator;
              head += metaData.getColumnName( metaData.getColumnCount());
              out.write( head.getBytes( OutputEncoding), 0, head.length());
              out.write( EOL, 0, 2);
             String record = new String();
             while( resultSet.next()){
              record = "";
              for( int i = 1; i < metaData.getColumnCount(); i++)
                  record += resultSet.getString( i) + Separator;
              record += resultSet.getString( metaData.getColumnCount());
              if( AfterLastColumnSeparator)
                  record += Separator;
              out.write( record.getBytes( OutputEncoding), 0, record.length());
              out.write( EOL, 0, 2);
             out.close();
             Date d2 = new Date();
                 System.out.println( "Done at " + d2);
                 System.out.println( "Executing time " + new Time( d2.getTime() - d1.getTime() - 10800000));
         catch( ClassNotFoundException e){
                 System.out.println( e.toString());
         catch( SQLException e){
                 System.out.println( e.toString());
         catch( java.io.IOException e){
                 System.out.println( e.toString());
         System.exit( 0);
        public static void main( String args[]){
         if( args.length == 1)
             new JDBCClient( args[0]);
         else
             System.out.println( "Usage JDBCClient <properties_file>");
    }JDBCClient.properties ( for Oracle database)
    DriverName=oracle.jdbc.driver.OracleDriver
    DatabaseURL=jdbc:oracle:thin:@192.168.1.1:1521:test
    UserName=test
    Password=test
    SQLFile=test.sql
    OutputFile=test.csv
    Separator=*
    NeedColumnHeaders=yes
    EncodingParamName=
    EncodingValue=
    OutputEncoding=windows-1251
    AfterLastColumnSeparator=yestest.sql
    select * from users;

  • How a java program is executed ?

    Hi,
    I would like to understand what a java program calls at first. Is it the main() ?
    Is it the same as C++ ?
    Is it different for an applet?
    thanks
    djb

    For an application, yes, public static void main(String[] args)
    (unlike C++ you cannot have main return an int, and it must have a String[] as a parameter)
    For an applet it calls public void init(), then usually public void start()
    Cheers,
    Radish21

  • Using a Java Program to execute JavaScript from a website

    Okay, let me try and explain as good as I can. I have a program now, that searched through all files and folders in Unix (Solaris machine) and gets the list of files in the bin and sbin folders.
    Well, I want to find the version of each of these files from the bin and sbin folders and not all of them have the -v, -V or -version feature (or any others there may be). But, I found this page:
    http://sunsolve.sun.com/pub-cgi/fileFingerprints.pl
    where if you go to the page I can find an md5 number, place it in the box and click submit to find versions, if available.
    My thing is, as I find the number from my java program, I want to be able to open this page, insert in the box (or maybe even call the javascript function) and then submit to get the version numbers. That would mean I could need to get back info from the javascript function.
    I hope that explains what I need and hope that someone can help me.
    I have found information on the JSObject, but not sure what that means exactly so if someone can explain this:
    JSObject win = JSObject.getWindow(this);
    JSObject doc = (JSObject) win.getMember("document");
    JSObject loc = (JSObject) doc.getMember("location");
    String s = (String) loc.getMember("href"); // document.location.href
    win.call("f", null);     
    it would be greatly appreciated. But, this may not even be what I need. I see that the win.call is where I would call the function needed and I am guessing the null could be where I put the number if that is how the function i need works like that. But, what I dont understand is what "document" is and "location". Also, i the "href" the page I put above? I am just lost on that. Hope someone will understand.
    Thank again for the help!

    Exactly so. Check out the last item - reading and writing to a URL - writing to a URL.
    Pulling out the form code from that page:
    <FORM METHOD="POST"  ENCTYPE="application/x-www-form-urlencoded">
    <TEXTAREA NAME="md5list" ROWS=16 COLS=66 MAXLENGTH="33792"></TEXTAREA>
    <BR><INPUT TYPE="submit" NAME="submit" VALUE="submit">
    <INPUT TYPE="reset" VALUE="reset">
    </FORM>You should end up with something like this (copying and pasting from the example):
    URL url = new URL("http://http://sunsolve.sun.com/pub-cgi/fileFingerprints.pl");
    String sNumbers = "put your serial nos in this string"
    URLConnection connection = url.openConnection();
    connection.setDoOutput(true);
    PrintWriter out = new PrintWriter(connection.getOutputStream());
    out.println("md5list=" + sNumbers);
    out.close();
    BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
    String inputLine;
    while ((inputLine = in.readLine()) != null){
      // read in the HTML page result for later parsing?
    in.close();

  • Which JAVA program should I download?

    I'm new to JAVA, can someone please tell me a good tutorial and program to create JAVA applets on?

    If you're new to Java, I suggest that you start first using simple text editor like Windows Notepad or Edit.com, because it may help you familiarize the Java language. Even though it's time-consuming, its worth, you can have a strong understanding about the Java language.
    You know what I�m having difficulties to say what I wanted to say because you know speaking English is my second language, so, to make it clear what I wanted to say, I will tell you a short story, so you listen...
    "I have a friend (she�s new to Java and she�s studying from other college school), she's using an IDE <software and company name is hidden / protected>, and yes that IDE is absolutely help her save her time developing her java program� the program is finished� time comes� she need to package her program for defense� packaging was successful� but when she run and test her program into one of the school�s computer� her program throws a bunch of exception (<software.company.********Tracker not found>) that isn�t occur when she�s running her program on her own PC (at home). She asked for my help (15mins before defense) and� 50% of the program crippled. I found that that IDE she�s using is semi-propriety and in the end, what happen is her group is assigned for re-defense, her time is not saved it is wasted."
    So be aware of the possible hidden price of time-saving routines and always be aware of what your IDE is doing under the cover. Also, your understanding might be impaired and you might feel helpless when you called on to debug your code in a computer with a minimum of tools without those cute IDE�s. Am I right? Correct me if I�m wrong. God bless you all ^_^
    For tutorial, see reply by kevljo.
    Thank you!

  • How can speed up my java program ? native code compilation ?

    Hello everyone, I know that there are so many post related to compiling to native code.
    My situation is that I wrote a little program that gets executed upto 50 times per second. This program basically gets a set of parameters and after validating them, they get inserted into a SQL Server 2000 table.
    I need this program to be faster ?
    I was thinking of writting this again on c++ but I don't know how to do it and I must do it myself.
    Thanks for you time,
    Sincerly Fabian.

    When we get 1500 traps in one second, the CPU
    utilization gets overloaded and the server crashes.C++ will be slightly faster if you are truly CPU-bound, assembly will be faster still. However, at some point nothing will be able to keep up. So the real question is whether Java provides enough development-level support and cross-platform capability to justify its slightly slower performance.
    Some things to think about:
    1) Are you running multiple threads to process incoming messages? You might be better off buffering the messages and processing them on a single or pooled thread. If the message traffic is truly bursty, and you don't need real-time response (which is illusory anyway), this should reduce your load.
    2) To echo another poster, are you really invoking a program for each message? Can you run that operation within the same JVM? There's a significant cost for each program start, as well as for context switches.
    3) You mentioned that you're writing to a database. Can you batch the writes? Individual writes result in more network round-trips, as well as more context switches.

  • Improving speed in a java program

    i have a fairly simple content blocking program, it accesses a database, this puts a user profile in an array to compare it against a web page classification.
    The database used is Oracle and I'm connecting with a JDBC thin client. The web page classifications are currently been loaded from a text file and inserted into an 2D array.
    My problem, the program is really slow.. i need to speed it up, any idea's or suggestion, area's to research.

    The code is a bit long but any thoughts would be appreciated
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    * This is a small program that will retreive the user profile data from the
    * database and checked it against random page classifiers created. This will
    * supply the number of pages blocked or accepted.
    * @author
    public class SetUpDatabase extends Object {
    private Connection conn; //A database connection
    int userId = -1; //The user id of the user who requested the internet content.
    //User Profile Variables used to store data from the user profile database
    boolean userProfileLocation = false; //The value of the location filter option in the user profile database.
    boolean userProfileKey =false; //The value of the Keyword filter option in the user profile database.
    boolean userProfileSkin =false; //The value of the Skin filter option in the user profile database.
    boolean userProfileIcra = false; //The value of the ICRA filter option in the user profile database.
    boolean userProfileRsaci = false; //The value of the RSACi filter option in the user profile database.
    boolean userIcra[] = new boolean [46]; //An array to store the Icra profile retrieved from the user profile database.
    int userRsaci[] = new int[6]; //An array to store the RSACi profile retrieved from the user profile database
    // 2D array variables used to store data retreived from the Files
    int incomingFileUser[][] = new int[100000][6]; //This 2d array is used to store the user profile extracted from a text file.
    int incomingFileIcra[][] = new int[100000][46]; //This 2d array is used to store the ICRA rating extracted from a text file.
    int incomingFileRsaci[][] = new int [100000][4]; //This 2d array is used to store the RSACi rating extracted from a text file.
    // Array variables to hold converted incoming web page classifiers
    boolean incomingPageClassifiers[] = new boolean[5]; //An array to store the internet content classifiers
    boolean incomingIcraRating[] = new boolean [48]; //An array to store the incoming ICRA rating
    int incomingRsaciRating[] = new int[5]; //An array to store the incoming RSACi rating
    // Counters
    //The amount of pages and records that have been processed
    int numBlocked = 0; //The number of pages not blocked.
    int numAllowed = 0; //The number of pages blocked.
    // Icra Filter Counters
    int icraCalled = 0; //The number of pages blocked with ICRA labels
    int icraAccepted = 0; //The number of pages blocked with ICRA labels
    int icraBlocked = 0; //The number of pages blocked with ICRA labels
    //Rsaci Filter Counters
    int rsaciCalled = 0; //To keep count of the total number of times the icra filter is called.
    int rsaciAccepted = 0; //The number of pages blocked with RSACi labels
    int rsaciBlocked=0; //The number of pages blocked with RSACi labels
    //Misc
    Random random = new Random(); //An object to create random numbers
    boolean blocked = false; //A switch to indicate if the page should be blocked.
    int numPages = 0; //A variable to hold the number of pages that have been put in the text box
    * Constructor
    * This connects to the database. It has methods that create random users, icra
    * and rsaci profile. It also access the user profile database to collect user profile
    * data.
    * @param numPages, this is an integer value from the User Interface specifying
    * the number of pages that are to be created.
    public SetUpDatabase(int incomingNumPages, String option) {
    numPages = (incomingNumPages-1);
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    } catch (ClassNotFoundException c){
    System.out.println("Problem:Could not load database drivers");
    if (option == "Random"){
    try {
    for(int i= 0;i <= numPages;i++) {
    userId = (int)((random.nextFloat()) * numPages);
    GetUserData();
    CreateRandomClassifiers();
    RandomFilter();
    } catch (SQLException h) {
    System.out.println ("Problem with the Random Option.");
    }else{
    try {
    int row = 0;
    int col = 0;
    int classifierIndex = 0;
    GetFileUser(numPages);
    GetFileIcra(numPages);
    GetFileRsaci(numPages);
    for(row= 0;row <= numPages;row++) {
    userId = (int)(incomingFileUser[row][0]);
    classifierIndex = 0;
    for(col=1;col<=5;col++){
    incomingPageClassifiers[classifierIndex]= ConvertBoolean(incomingFileUser[row][col]);
    classifierIndex++;
    col=0;
    for(col=0;col<=45;col++){
    incomingIcraRating[col] = ConvertBoolean(incomingFileIcra[row][col]);
    col=0;
    for (col=0;col<=3;col++){
    incomingRsaciRating[col] = incomingFileRsaci[row][col];
    col=0;
    String dburl="jdbc:oracle:thin:@192.168.0.1:1521:up";
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(dburl,"gary","happygary");
    // conn = DriverManager.getConnection("jdbc:oracle:oci8:@UP","gary","happygary");
    GetUserData();
    FileFilter();
    conn.close();
    //System.out.println("row= "+row+" the user ="+userId + "numALlowed =" + numAllowed);
    } catch (SQLException h) {
    System.out.println ("Method calling problem");
    * Method - This goes to the database and gets the user profile information,
    * it uses the random user id from CreateRandomUser method.
    void GetUserData () throws SQLException {
    try {
    Statement s = conn.createStatement();
    String state = ("SELECT * FROM user_profile WHERE user_id=" + userId);
    ResultSet rset = s.executeQuery (state);
    while (rset.next()) {
    int temp[] = new int[5];
    int col=6;
    for (int i = 0;i<=4;i++){
    temp= rset.getInt(col);
    col++;
    userProfileLocation =ConvertBoolean(temp[0]);
    userProfileKey = ConvertBoolean(temp[1]);
    userProfileSkin = ConvertBoolean(temp[2]);
    userProfileIcra = ConvertBoolean(temp[3]);
    userProfileRsaci = ConvertBoolean(temp[4]);
    rset.close(); // close the resultSet
    s.close(); // Close the statement
    } catch (SQLException g) {
    System.out.println ("did not work");
    * Method - This creates a random user profile
    void CreateRandomClassifiers() {
    float randomNumber = 0;
    randomNumber = random.nextFloat(); // This creates a random number between 0.0 - 1.0, this is for the user_id By multiplying the random number by 1000 we can create a random number between 0 and 1000
    userId = ((int)(randomNumber *1000));
    for (int i =0;i<4;i++){
    incomingPageClassifiers[i] = CreateRandomBoolean(10.5);
    * Method - Filter
    * This compares the incoming internet classification with the retrieved database information.
    void RandomFilter () throws SQLException {
    try {
    if ((userProfileLocation ==true && incomingPageClassifiers[0]==true)||(userProfileKey==true && incomingPageClassifiers[1]==true)||(userProfileSkin==true && incomingPageClassifiers[2]==true)){
    numBlocked ++;
    } else if ((incomingPageClassifiers[3]==true && userProfileIcra == true)) {
    GetUserIcra();
    CreateRandomIcra();
    IcraFilter();
    } else if ((incomingPageClassifiers[4]==true && userProfileRsaci == true)){
    GetUserRsaci();
    CreateRandomRsaci();
    RsaciFilter();
    } else {
    numAllowed ++;
    }catch (SQLException l){
    System.out.println ("filter problem");
    * Method - Filter
    * This compares the incoming internet classification with the retrieved database information.
    void FileFilter () throws SQLException {
    try {
    if ((userProfileLocation == true) && (incomingPageClassifiers[0]==true)){
    blocked = true;
    } else if ((userProfileKey == true) && (incomingPageClassifiers[1]==true)){
    blocked = true;
    }else if ((userProfileSkin==true) && (incomingPageClassifiers[2]==true)){
    blocked = true;
    }else if ((userProfileIcra == true) && (incomingPageClassifiers[3]== true)) {
    GetUserIcra();
    IcraFilter();
    } else if ((userProfileRsaci == true) && (incomingPageClassifiers[4]==true)){
    GetUserRsaci();
    RsaciFilter();
    } else {
    blocked = false;
    if (blocked == true ){
    numBlocked++;
    blocked = false;
    } else {
    numAllowed++;
    }catch (SQLException l){
    System.out.println ("Filter problem");
    * Method - GetUserICra
    * This accesses the User Profile database and gets the ICRA profile details
    void GetUserIcra() throws SQLException {
    try {
    Statement s = conn.createStatement();
    String state = ("SELECT * FROM Icra WHERE user_id=" + userId);
    ResultSet rset = s.executeQuery (state);
    ResultSetMetaData rsmd = rset.getMetaData();// get the number of columns
    int numCols = rsmd.getColumnCount ();
    int icraIndex=0;
    while (rset.next()) {
    for (int colNum =2;colNum<=46;colNum++){
    userIcra[icraIndex] = rset.getBoolean (colNum);
    icraIndex++;
    rset.close(); // Close the resultSet
    s.close(); // Close the statement
    } catch (SQLException g) {
    System.out.println ("Problem with Obtaining ICRA profile from database");
    * Method - GetUserRSACi
    * This gets the Rsaci profile data from the User Profile Database
    void GetUserRsaci() throws SQLException {
    try {
    Statement s = conn.createStatement();
    String state = ("SELECT * FROM Rsaci WHERE user_id=" + userId);
    ResultSet rset = s.executeQuery (state);
    ResultSetMetaData rsmd = rset.getMetaData(); // get the number of columns
    int numCols = rsmd.getColumnCount ();
    int rsaciIndex=0;
    while (rset.next()) {
    for (int colNum =2;colNum<=5;colNum++){
    userRsaci[rsaciIndex] = rset.getInt (colNum);
    rsaciIndex++;
    rset.close(); // close the resultSet
    s.close(); // Close the statement
    } catch (SQLException g) {
    System.out.println ("Problem with Rsaci");
    * Method - CreateRandomIcra
    * This creates a random icra classification
    * @return It stores a boolean value in the pageIcra array variable
    void CreateRandomIcra () {
    for (int i = 2; i<=45;i++) {
    incomingIcraRating[i]=CreateRandomBoolean(1.1);
    * Method - CreateRandomRsaci
    * This creates the integer values between 0-9 for a rsaci profile.
    * @return It stores the random Rsaci profile in a pageRsaci variable
    void CreateRandomRsaci () {
    for (int i = 2; i<=5;i++) {
    incomingRsaciRating[i]=CreateRandomInteger(10);
    * Method - IcraFilter
    * The Icra Filter
    void IcraFilter() {
    icraCalled++;
    for (int i = 0;i<=45;i++) {
    if ((userIcra[i] == true) && (incomingIcraRating[i] == true)){
    blocked = true;
    if (blocked == true) {
    icraBlocked++;
    } else {
    icraAccepted++;
    * Method -RsaciFilter
    * The Rsaci Filter
    void RsaciFilter() {
    rsaciCalled++;
    for (int i = 0;i<=3;i++) {
    if ((userRsaci[i] >= 1) && (incomingRsaciRating[i] <= userRsaci[i])){
    blocked = true;
    if (blocked == true) {
    rsaciBlocked++;
    } else {
    rsaciAccepted++;
    * Method -This creates a random boolean.
    * @param - percentage of likelyhood that boolean is true
    * @return - boolean value
    boolean CreateRandomBoolean(double percentage) {
    double indicator = (random.nextFloat())*100;
    if (indicator <= percentage) {
    return true;
    } else {
    return false;
    * Method - CreateRandomInteger
    * @return Creates a random integer between the value of 0-9.
    private int CreateRandomInteger(int percentage){
    int indicator = 0;
    indicator = (int)((random.nextFloat())*100);
    if (indicator <= percentage) {
    return(int)((random.nextFloat())*10);
    } else {
    return 0;
    void GetFileUser(int numPages){
    // assuming doubles and assuming you know the number
    // of rows is m and the number of columns is n...
    int numRows = numPages;
    String line = null;
    StringTokenizer st = null;
    int row = 0;
    int column = 0;
    try {
    BufferedReader in = new BufferedReader(new FileReader("C:\\java\\user.txt"));
    // assuming each line contains one row of n values
    try{
    while( (( line = in.readLine())!= null)&&(row <=numRows)){
    st = new StringTokenizer(line, ", ");
    while(st.hasMoreTokens()) {
    try{
    incomingFileUser[row][column] = new Double(st.nextToken()).intValue();
    } catch(NumberFormatException nfe) {
    incomingFileUser[row][column] = 0;
    column++;
    column=0;
    row++;
    }catch (IOException ioe){
    System.out.println("File reading error");
    } catch (FileNotFoundException e){
    System.out.println("File Not Found");
    void GetFileIcra(int numPages){
    // assuming doubles and assuming you know the number
    // of rows is m and the number of columns is n...
    int numRows = numPages;
    String line = null;
    StringTokenizer st = null;
    int row = 0;
    int column = 0;
    try {
    BufferedReader in = new BufferedReader(new FileReader("C:\\java\\icra.txt"));
    // assuming each line contains one row of n values
    try{
    while( (( line = in.readLine())!= null)&&(row <numRows)){
    st = new StringTokenizer(line, ", ");
    while(st.hasMoreTokens()) {
    try{
    incomingFileIcra[row][column] = new Double(st.nextToken()).intValue();
    } catch(NumberFormatException nfe) {
    incomingFileRsaci[row][column] = 0;
    column++;
    column=0;
    row++;
    }catch (IOException ioe){
    System.out.println("file reading error");
    } catch (FileNotFoundException e){
    System.out.println("File Not Found");
    void GetFileRsaci(int numPages){
    // assuming doubles and assuming you know the number
    // of rows is m and the number of columns is n...
    int numRows = numPages;
    String line = null;
    StringTokenizer st = null;
    int row = 0;
    int column = 0;
    try {
    BufferedReader in = new BufferedReader(new FileReader("C:\\java\\rsaci.txt"));
    // assuming each line contains one row of n values
    try{
    while( (( line = in.readLine())!= null)&&(row <numRows)){
    st = new StringTokenizer(line, ", ");
    while(st.hasMoreTokens()) {
    try{
    incomingFileRsaci[row][column] = new Integer(st.nextToken()).intValue();
    } catch(NumberFormatException nfe) {
    incomingFileRsaci[row][column] = 0;
    column++;
    column = 0;
    row++;
    }catch (IOException ioe){
    System.out.println("file reading error");
    } catch (FileNotFoundException e){
    System.out.println("File Not Found");
    boolean ConvertBoolean(int number) {
    if (number == 1){
    return true;
    } else{
    return false;
    * Method - This opens the database connection
    //accessor methods
    public int GetNumberBlocked (){
    return numBlocked;
    public int GetNumberAllowed(){
    return numAllowed;
    public int GetIcraCalled(){
    return icraCalled;
    public int GetIcraAccepted(){
    return icraAccepted;
    public int GetIcraBlocked(){
    return icraBlocked;
    public int GetRsaciCalled(){
    return rsaciCalled;
    public int GetRsaciAccepted(){
    return rsaciAccepted;
    public int GetRsaciBlocked(){
    return rsaciBlocked;

  • Which java exceptions are "critical"?

    We have a production EP 7.0 with 1000+ users using ESS/MSS and CRM and soon BI. The J2EE engine is throwing 1000s of exceptions (actually there are 10081 in default.X.trc), how do I know, which ones of those impact production? We have SolManDiag and Wily in place but I haven´t found yet anyone, who´s able to tell me how to monitor the portal, not in sense of performance but in sense of proactive monitoring.
    Example:
    If I see something like
    #1.5#00118513360B0059000002C2000017680004323F12C40B83#1181146386008#com.sap.portal.portal#sap.com/irj#com
    .sap.portal.portal#reichmannj#162823##portal_POP_5365450#reichmannj#c9643260144811dcc0c200118513360b#SAPE
    ngine_Application_Thread[impl:3]_24##0#0#Error#1#/System/Server#Plain###ErrorPage: com.sap.pct.hcm.employ
    eeprofile.monitoringoftasks.r3proxies.Hrwpc_Rfc_Montask_Getlist_FaultException:  - NO_AUTHORIZATION#
    is that a systemic error that an administrator/operator needs to take care of or is this "just" a user trying to execute something he has no permissions?
    Second example is
    #com.sap.sql.types.BigintResultColumn#Guest#1####1f131960148a11dcb39700118513360b#SAPEngine_Application_T
    hread[impl:3]_24##0#0#Error#1#/System/Database/sql/types#Java#com.sap.sql_0019##Exception of type com.sap
    .sql.log.OpenSQLException caught: Cannot fetch column 2, which has JDBC type BIGINT, into a Java variable
    of type int..
    #3#com.sap.sql.log.OpenSQLException#Cannot fetch column 2, which has JDBC type BIGINT, into a Java va
    riable of type int.#com.sap.sql.log.OpenSQLException: Cannot fetch column 2, which has JDBC type BIGINT,
    into a Java variable of type int.
            at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
            at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
            at com.sap.sql.types.TypedResultColumn.fetchError(TypedResultColumn.java:74)
            at com.sap.sql.types.TypedResultColumn.getInt(TypedResultColumn.java:91)
            at com.sap.sql.jdbc.common.CommonResultSet.getInt(CommonResultSet.java:369)
    I can see that this is some sort of SQL error but I don´t see who or what triggered that command (there´s nothing above or below) nor do I see here, what´s the cause of that. For me it´s impossible to distinguish, if I need to react and do something or not.
    Can anyone throw a light on that please? I´d HIGHLY appreciate...
    Regards,
    Markus

    The main problem is, that nowhere is documented, how to configure. If we do implement BI-Java, I have absolutely no clue, what needs to be configured in sense of monitoring and where to have a special look on. I´m aware that tuning a system is an iterative process and that there is no "default-is-good" configuration, but a little help (in sense of documentation) will be very helpful.
    I don´t know, if some BI-Java parts use SLD or not, it´s simply a blackbox, one has a step-by-step (well, almost) configuration guide, but one does not know, how each components interact with each other, with the portal or the backend.
    Imagine if ABAP (what is a virtual machine as Java is) wouldn´t have ST22, ST04, ST02, SM21, SM50/SM66 but just simple textfiles where everything from each module/component is written as plain text bumped into one single file. If 1000 users work on the system concurrently and you have an 8 MB textfile at the end of the day, wouldn´t you ask if that could be done "better"?
    Maybe I´m just too demanding and spoiled from ABAP but if we put a system of that size into production I must have a possibility to track, to monitor and to "watch" the system in a way, I can decide, whether I need to act or not. If that´s not possible as of now, I´m really wondering, if we use the right "tool" if that amount of complexity and abstraction is necessary to achieve the goal. I don´t feel good and what I read here doesn´t add the feeling of "good, we will be able to manage it somehow".
    The purpose of a portal is (in the end) to make tasks easier (to optimize a business process) and eventually help the company to gain more money, it´s not to have technology ending it itself due to an unmanageable amount of complexity.
    Markus

  • Which lenovo programs are useless to have??

    I would like to clear up some of lenovos programs that are taking up space on he computer.  If I clean up some stuff will I reduce start up and shut down times?

    Without having to even know what they do? 
    You know some of them can be really helpful to you but before removing them you ought to know what they do:- http://forum.notebookreview.com/showthread.php?p=2​407893
    Maliha (I don't work for lenovo)
    ThinkPads:- T400[Win 7], T60[Win 7], IBM 240[Win XP]
    IdeaPad: U350
    Apple:- Macbook Air [Snow Leopard]
    Did someone help you today? Compliment them with a Kudos!
    Was your question answered today? Mark it as an Accepted Solution! 
      Lenovo Deutsche Community     Lenovo Comunidad en Español 
    Visit my YouTube Channel

  • Which VOD programs are really "free"?

    I need more information on what is actually "free" (or more accurately, included).  I have the Ultimate package, so I have the premiums, and in fact just about everything anyone could want.  But I also got 2 DVRs, and I'm wondering if I even need them, what with VOD.  For example, if I want to catch up on "The Daily Show", is that included/free?  What about "Mad Men"?  If I want to catch up on the first 3 seasons, is that included/free?  I'm asking because when I look at "My rentals", it shows an episode of TDS that I watched yesterday, but I am showing no purchases.  Can anyone clarify this?

    Very hard to say.
    When browsing be sure to look at the group that says free.  And look at premium channels you subscribe to.
    But also make sure you have purchases locked with a password (its under parental controls).  That way you will get a warning if you searched or otherwise came upon a VOD that is not free, and select it thinking its free. 

Maybe you are looking for

  • Free Item ticked in R/3 PO - Extended Classic Scenario

    Hi All, We are working in SRM4.0 , Exteneded Classic Scenario, Its a catalgoue item, In SC# its having a Net Value say $3,500, but when i checked PO in the R/3 , it shows the Net price is 0.0 (zero) and Free Item is ticked. Why the PO shows net value

  • Servive Freight in Import PO

    Dear Grurus I have very common import scenario.I expalin it with the following example. I import material from foreign vendor whose cost is say 100 dollars.This is to be paid to foreign vendor.As PO is in name of that vendor so no issues on that. I t

  • Table row change color on hover

    Hi, I don't know if it's possible to change table row color on mouse hover, I've been looking at skin-selectors (http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html#Global%20Selectors) and I have

  • Import bookmarks from firefox

    My existing Firefox software is corrupt and I am unable to get my bookmarks from my Time Machine.  I either need to find out how to get them out of my Time Machine or import them into Safari.

  • Can't delete custom dictionary 8120

    Whenever I try to delete or clear the custom dictionary on my 8120, it clears out. However after a battery pull reboot everything reappears. If I use the Desktop manager 5.0 and go to backup/restore>advanced I try to cleat the custom words collection