Help with Threads in java...

Hi all,
the problem it's the following:
i got a program that update a sql server table. So i want, at the same time, run this program many times, say 10 for example, to do it that faster.
But i only want 10 subprograms at the same time. So i got to use wait() and others method's, rigth?
I'm not shure about this, because a never use threads.
So any help, code or "pseudocode" will be very appreciated.
Thanks in advance
A. Santos

Hi santhos,
If u use 10 threads to read the sql table, then
ur program will lose the sequence. If u have a idea
to split the program then u can use threads.
Regards,
Palaniyappan

Similar Messages

  • Help with Threads

    I need help with threads. How can I break this code into teo threads without chaning the data objects at all? Producer will produce string line by line and consumer will take the line and search for the word. Help me please.
    Thank you
    public class WordFinder
    * Main program opens the file given by the user as an argument and
    * searches for the word given by the user. If the word is found,
    * the line number on which the word occurs is displayed.
    * @param args[0] Word to search for
    * @param args[1] Name of file to search
    public static void main(String[] args) throws IOException
    // To keep track of how long the program runs we'll set the startTime
    // variable to the current time in milliseconds and use that at
    // the end of the program to find out how long we ran.
    long startTime = System.currentTimeMillis();
    String wordToFind;
    String currentLine;
    int lineCount = 0; // Keep track of line numbers
    BufferedReader inputFile = null; // Needed to get compiler to quit
    // complaining about uninitialized
    // variables.
    // Make sure we have 2 arguments passed to us
    if (args.length < 2)
    // Nope. Show user how to run and then exit with an error (1)
    System.out.println("usage: java WordFinder <word> <file pathname>");
    System.exit(1);
    // So far, so good. Now try to open the file the user gave us as
    // a parameter. We'll use a BufferedReader object to read the file
    // so we can read one line at a time from the input. If opening the
    // file fails, print an error message and exit with an error (1).
    try
    inputFile = new BufferedReader(new FileReader(args[1]));
    catch (FileNotFoundException e)
    System.out.println(args[1] + ": File not found or is not readable");
    System.exit(1);
    // Set the wordToFind variable to refer to args[0]. We don't
    // really need to do this, but it makes our code more readable
    wordToFind = args[0];
    // We're going to read the file one line at a time. For each
    // line, we'll create a StringTokenizer object to break the line
    // into distinct words, checking each word to see if it's the same
    // as the given search word.
    // Read first line from the file
    currentLine = inputFile.readLine();
    while (currentLine != null) // Repeat until we reach EOF
    // Have a valid input line, increment the counter
    lineCount++;
    // Create a StringTokenizer object over the current line
    StringTokenizer tokens = new StringTokenizer(currentLine);
    // Check each word in the string by accessing each token
    while (tokens.hasMoreTokens())
    // See if the next word is the one we're looking for and
    // advance the token iterator to the next token
    if (wordToFind.equals(tokens.nextToken()))
    // Yes, display the current line number
    System.out.println(wordToFind + " found on line " + lineCount);
    // Read next line from the file
    currentLine = inputFile.readLine();
    } // while
    // Done with the input file
    inputFile.close();
    // Display the running time of this program in milliseconds by
    // subtracting the start time from the current time
    System.out.println((System.currentTimeMillis() - startTime) + " milliseconds");
    } // main
    } // WordFinder

    You may create Queue object. (I guess that you're already know QUEUE)
    Then ... use producer thread to load input file into queue. (Enqueue)
    Consumer ... dequeue
    Queue can be empty because of
    - Input file was read to EOF and Consumer had produced all queue.
    or
    - Cunsumer works too fast... So the queue is empty.
    So, you may have to use ... wait() in Consumer in case of the queue is empty.
    And use notify() in Producer to wake up consumer ...
    Is this right ?

  • Help with Thread dump analisys

    We have problems with our application which runs on bea8.1 sp1.
    Problem is that bea runs out from Threads (StuckThreads).
    thread dums look same for all threads but i can's see what is wrong.
    Here are dumps from first and last threads :
    "ExecuteThread: '1' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x7f3628
    nid=0xd runnable [a6280000..a6281994
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c3197aa0> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "ExecuteThread: '24' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x6dd548
    nid=0x24 runnable [a3d80000..a3d819
    94]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c30c5010> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Rob Woollen <[email protected]> wrote:
    Can you post the full thread dump?
    It looks like you have some code making an RMI call over the network.
    Is it calling another server, or perhaps a loopback call into the same
    server. The latter (opening a socket to your own process) is a good
    way
    to get a deadlock.
    -- Rob
    dara wrote:
    We have problems with our application which runs on bea8.1 sp1.
    Problem is that bea runs out from Threads (StuckThreads).
    thread dums look same for all threads but i can's see what is wrong.
    Here are dumps from first and last threads :
    "ExecuteThread: '1' for queue: 'weblogic.kernel.Default'" daemon prio=5tid=0x7f3628
    nid=0xd runnable [a6280000..a6281994
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c3197aa0> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "ExecuteThread: '24' for queue: 'weblogic.kernel.Default'" daemon prio=5tid=0x6dd548
    nid=0x24 runnable [a3d80000..a3d819
    94]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c30c5010> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    Thanks Rob,
    sorry for delay but I was on vacation.
    You are right about RMI, our app. consist from FE (front end) and BE (back end),
    comunication between them is RMI.
    We had some problems with BE but now we have new version and it looks ok.
    Anyway thanks for help, if I will have again some problems then it will be
    Help with thread analisys 2 ;-)

  • Need help with running a Java program on Linux

    I am trying to get a Java program to run on a Linux machine. The program is actually meant for a Mac computer. I want to see if someone with Java experience can help me determine what is causing the program to stall. I was successful in getting it installed on my Linux machine and to partially run.
    The program is an interface to a database. I get the login screen to appear, but then once I enter my information and hit enter the rest of the program never shows, however, it does appear to connect in the background.
    Here is the error when I launch the .jar file from the command screen:
    Exception in thread "main" java.lang.IllegalArgumentException: illegal component position
    at java.awt.Container.addImpl(Unknown Source)
    at java.awt.Container.add(Unknown Source)
    I am not a programmer and I am hoping this will make some sense to someone. Any help in resolving this is greatly appreciated!

    Well, without knowing a little bit about programming, and how to run your debugger, I don't think you're going to fix it. The IllegalArgumentException is saying that some call does not like what it's getting. So you'll have to go in an refactor at least that part of the code.

  • Need help with threads?.. please check my approach!!

    Hello frnds,
    I am trying to write a program.. who monitors my external tool.. please check my way of doing it.. as whenever i write programs having thread.. i end up goosy.. :(
    first let me tell.. what I want from program.. I have to start an external tool.. on separate thread.. (as it takes some time).. then it takes some arguments(3 arguments).. from file.. so i read the file.. and have to run tool.. continously.. until there are arguments left.. in file.. or.. user has stopped it by pressing STOP button..
    I have to put a marker in file too.. so that.. if program started again.. file is read from marker postion.. !!
    Hope I make clear.. what am trying to do!!
    My approach is like..
    1. Have two buttons.. START and STOP on Frame..
    START--> pressed
    2. check marker("$" sign.. placed in beginning of file during start).. on file..
         read File from marker.. got 3 arg.. pass it to tool.. and run it.. (on separate thread).. put marker.. (for next reading)
         Step 2.. continously..
    3. STOP--> pressed
         until last thread.. stops.. keep running the tool.. and when last thread stops.. stop reading any more arguments..
    Question is:
    1. Should i read file again and again.. ?.. or read it once after "$" sign.. store data in array.. and once stopped pressed.. read file again.. and put marker ("$" sign) at last read line..
    2. how should i know when my thread has stopped.. so I start tool again??.. am totally confused.. !!
    please modify my approach.. if u find anything odd..
    Thanks a lot in advance
    gervini

    Hello,
    I have no experience with threads or with having more than run "program" in a single java file. All my java files have the same structure. This master.java looks something like this:
    ---master.java---------------------------------------------------
    import java.sql.*;
    import...
    public class Master {
    public static void main(String args []) throws SQLException, IOException {
    //create connection pool here
    while (true) { // start loop here (each loop takes about five minutes)
    // set values of variables
    // select a slave process to run (from a list of slave programs)
    execute selected slave program
    // check for loop exit value
    } // end while loop
    System.out.println("Program Complete");
    } catch (Exception e) {
    System.out.println("Error: " + e);
    } finally {
    if (rSet1 != null)
    try { rSet1.close(); } catch( SQLException ignore ) { /* ignored */ }
    connection.close();
    -------end master.java--------------------------------------------------------
    This master.java program will run continuously for days or weeks, each time through the loop starting another slave process which runs for five minutes to up to an hour, which means there may be ten to twenty of these slave processes running simultaneously.
    I believe threads is the best way to do this, but I don't know where to locate these slave programs: either inside the master.java program or separate slave.java files? I will need help with either method.
    Your help is greatly appreciated. Thank you.
    Logan

  • Need some help with threads...

    Hello all,
    I am working on a project at work, and I am not the best programmer in the world. I have been trying to get my head around this for a couple of days and just cannot get it to work.
    I am writing an instrumentation control program that will have three threads. One is the GUI, one will receive control information and set up the hardware, and one will check the hardware status and report it to the GUI periodically. I plan on using the invokeLater() method to communicate the status to the GUI and change the status display in the GUI. Communication from the GUI to the controller thread and from the status thread to the controller thread I had planned on being piped input/output stream as appropriate. I have a control class and a status class that need to be communicated over these piped streams. In some trial code I have been unable to wrap the piped input/output streams with object input/output streams. I really need some help with this. Here is the main thread code:
    package playingwiththreads1;
    import java.io.*;*
    *public class PlayingWithThreads1 {*
    public static void main(String[] args) {*
    * PipedOutputStream outputPipe = new PipedOutputStream();*
    * ObjectOutputStream oos = null;*
    * ReceiverThread rt = new ReceiverThread(outputPipe);*
    // Start the thread -- First try*
    * Thread t = new Thread(rt);*
    t.start();*
    // Wrap the output pipe with an ObjectOutputStream*
    try*
    oos = new ObjectOutputStream(outputPipe);*
    catch (IOException e)*
    System.out.println(e);*
    // Start the thread -- Second try*
    //Thread t = new Thread(rt);*
    //t.start();*
    /** Send an object over the pipe. In reality this object will be a
    class that contains control or status information */
    try
    if (!oos.equals(null))
    oos.writeObject(new String ("Test"));
    catch (IOException e)
    try
    Thread.sleep(5000);
    catch (InterruptedException e)
    I read somewhere that it matters where you start the thread relative to where you wrap piped streams with the object streams. So, I tried the two places I felt were obvious to start the thread. These are noted in the comments. Here is the code for the thread.
    package playingwiththreads1;
    import java.io.*;
    public class ReceiverThread implements Runnable {
    private PipedInputStream inputPipe = new PipedInputStream();
    private ObjectInputStream inputObject;
    ReceiverThread (PipedOutputStream outputPipe)
    System.out.println("Thread initialization - start");
    try
    inputPipe.connect(outputPipe);
    inputObject = new ObjectInputStream(inputPipe);
    catch (IOException e)
    System.out.println(e);
    System.out.println("Thread initialization - complete");
    public void run()
    System.out.println("Thread started");
    try
    if (inputObject.available() > 0)
    System.out.println(inputObject.read());
    catch (IOException e)
    System.out.println(e);
    Through testing I have determined that no matter where I start the thread, the thread never gets past the "inputObject = new ObjectInputStream(inputPipe);" assignment.
    Could someone please help me with this? There are other ways for me to write this program, but this is the one that I would like to make work.
    Many thanks in advance,
    Rob Hix
    Edited by: RobertHix on Oct 6, 2009 3:54 AM

    Thanks for the help, but that did not work. I tried flushing the ObjectOutputStream and it is still hanging when initializing the thread.
    Here is a better look at the code since I was helped to figure out how to insert it:
    The main method:
    package playingwiththreads1;
    import java.io.*;
    public class PlayingWithThreads1 {
        public static void main(String[] args) {
            PipedOutputStream outputPipe = new PipedOutputStream();
            ObjectOutputStream oos = null;
            ReceiverThread rt = new ReceiverThread(outputPipe);
            // Start the thread -- First try
            //Thread t = new Thread(rt);
            //t.start();
            // Wrap the output pipe with an ObjectOutputStream
            try
                oos = new ObjectOutputStream(outputPipe);
                oos.flush();
            catch (IOException e)
                System.out.println(e);
            // Start the thread -- Second try
            Thread t = new Thread(rt);
            t.start();
            /* Send an object over the pipe.  In reality this object will be a
             * class that contains control or status information */
            try
                if (!oos.equals(null))
                    oos.writeObject(new String ("Test"));
                    oos.flush();
            catch (IOException e)
                System.out.pringln(e);
            try
                Thread.sleep(5000);
            catch (InterruptedException e)
    }The thread code:
    package playingwiththreads1;
    import java.io.*;
    public class ReceiverThread implements Runnable {
        private PipedInputStream inputPipe = new PipedInputStream();
        private ObjectInputStream inputObject;
        ReceiverThread (PipedOutputStream outputPipe)
            System.out.println("Thread initialization - start");
            try
                inputPipe.connect(outputPipe);
                inputObject = new ObjectInputStream(inputPipe);
            catch (IOException e)
                System.out.println(e);
            System.out.println("Thread initialization - complete");
        public void run()
            System.out.println("Thread started");
            try
                if (inputObject.available() > 0)
                    System.out.println(inputObject.read());
            catch (IOException e)
                System.out.println(e);
    }Does anyone else have and ideas?

  • Help with error  "main" java.lang.NoClassDefFoundError:

    I am pretty new to Java and I just install the JDK1.4.2 03
    I am getting an error when I run the class file TestChart.class with the
    java.exe:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    I have several class files in the directory d:\personal\java-ChartGen
    Chart.class
    ChartColourScheme.class
    ChartPanel.class
    ColorPanel.class
    TestChart.class
    TestIt.class
    All these files are for the program.
    Can some one help me why is this happening?? Is there something I can do
    that I am missing???
    I tried using the -CLASSPATH to direct it to the same directory but still
    with the same error.
    Please help me. Thank you

    I use the command line as follows:
    c:\j2sdk1.4.2_03\bin\java d:\personal\java-ChartGen\TestChart.class
    The full error message is as follows:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    d:\personal\java-ChartGen\TestChart/class
    I thought it may be the CLASSPATH, but all my class files are located in the
    same folder and I used the switch -classpath but the same error comes up.

  • Looking for Help with Hyperion to JAVA

    I am looking for help with connecting Hyperion to Java. We are in Maryland but would be willing to work out something for remote consulting. If you have experience with connecting web services, hyperion, and Java and would be interested in about 80 hours of consulting please contact me at:[email protected] x4846

    Hi,
    From your description, you want to achieve the following goal:
    Configure Exchange to filter the attachments if the size is over 10 MB and store it in a public folder, and then forward the email to Salesforce.
    Based on my knowledge, I'm afraid that it can't be achieved. Exchange can filter messages with attachments, but it couldn't store these attachments on public folder automatically. Also, I don't see any transport rule can do it.
    Hope my clarification is helpful.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Help with LabView and Java

    Hi any help would be greatly appreciated: I have the following JAVA code:
    //File: Hello.java
    class Hello {
     public native void Steve();
     static {
      System.loadLibrary("steve");
     public static void main(String[] args) {
      Hello h = new Hello();
      h.Steve();
    It finds the loadLibrary fine, but I get the following error message:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: Steve
    at Hello.Steve(Native Method)
    at Hello.main(Hello.java:10)

    Okay......
    Where does Labview fit into this question?

  • Help on Threads in Java

    I need some basic help in regards to threading in Java.
    I have no history of writing threaded applications in any programming language.
    I'm working on a kind of web bot, for a bunch of XML sources. There are 10's of thousands of sources and the timestamp difference between the lastest and last updated item is growing to almost a full day! This is not good enough really.
    Here's the basic layout of the main class:
    public class filer {
        private static class bot implements Runnable {
            private mysql db;
            private int botID;
            public bot(final int ID) {
                botID = ID;
                try {
                    // Some prepared statements here...
                catch (SQLException ex) {System.exit(0);}
                catch (NoSuchAlgorithmException ex) {System.exit(0);}
            public void run() {
                db = new mysql("localhost", "xxx", "xxx", "xxx");
                if (db.connected == true) spider();
                else System.exit(0);
            final void spider() {
                // Spider logic here using botID...
                spider(); // Recursion...
        public static void main(String[] args) {
            for (int i = 0; i < 51; i++) (new Thread(new bot(i))).start();
    }I'm trying to run 50 threads, each doing their task of downloading data, parsing it and inserting where applicable into the MySQL database. 50 should reduce difference in last and latest crawled to 1 hour, which would be great!
    Am I missing something? Is there anything special that needs to be taken into consideration when using MySQL?
    Any help much appreciated!

    Wow, that's a bummer :-(
    I managed to get this working, showing 50 simultaneous connections to MySQL, but the connections appear to be "sleeping" most of the time which leads me to believe it's the problem you're suggesting.
    Thanks for the heads up, could save me a lot of headaches!

  • Help with a SIMPLE java thing

    I've only got ONE handful of hair left.
    I'm trying to build a series of dropdown boxes; a day dropdown (Mon, Tue, Wed...), a month dropdown (Jan, Feb, Mar...), a year dropdown, hour dropdown, minute dropdown, and an am/pm dropdown.
    I think I want to build my dropdowns using "for" loops something like this:
    for (i=0;i<12;i++) {
    myStringBuffer.append("<option>" + [someUnknownFunctionThatReturnsTheFirstThreeLettersOfTheMonth(i)] + "</option>")
    I've been trying to mix up various combinations of Date objects (most date functions seem to be depreciated), Calendar Objects, DateFormat Objects and SimpleDateFormat Objects but nothing seems to want to perform the function that I need.
    I've had iffy success creating a calendar object, setting the Month to "i", using the getTime function to return a Date object which I can then pass to the SimpleDateFormat object using the .format(Date) function, after setting the pattern to "EEE", but it seems like just an incredibly complicated way to do what ought to be a simple function...i.e. convert a number 0-11 (or 1-12, I'm not picky) into the name of a stinking Month! Arrgh.
    If anyone can help, I thank you.

    I've done that before, so i'll share it with you.
    import java.text.SimpleDateFormat;
    import java.text.DateFormatSymbols;
    import java.util.Calendar;
    import java.util.Date;
    public String createListOfMonth(String pName) {
    StringBuffer sbMonth = new StringBuffer();
    DateFormatSymbols fm = new DateFormatSymbols();
    String[] arrMonth = fm.getMonths();
    sbMonth.append("<select name=\"" + pName + "\">");
    sbMonth.append("     <option value=\"\">Month</option>\n");
    for (int i=0; i<arrMonth.length; i++) {
    if (!arrMonth.trim().equals("")) {
    String sValue = "0000" + (i + 1);
    sValue = sValue.substring(sValue.length() - 2);               
    sbMonth.append("     <option value=\"" + sValue + "\">" + arrMonth[i] + "</option>\n");
    sbMonth.append("</select>");
    return (sbMonth.toString());
    You can manipulate the symbol (either for months, days) using different locale. You can see the API for java.text.DateFormatSymbols in Java2 SE.
    Regards,
    Hariyanto

  • Im DROWNING! need help with a simple java assignment! plz someone help me!

    i need help with my java assignment, with validating a sin number. easy for must who know java. im drowning... please help!

    You will need to store each digit of the social insurance number in a field of its own. To validate the entry you will:
    1. Multiply the 2nd, 4th, 6th and 8th digit by 2.
    2. If the product of any of the four multiplications result in a value greater than 9, add the two resulting digits together to yield a single-digit response. For example 6 * 2 = 12, so you would add the 1 and the 2 to get a result of 3.
    3. Add these four calculated values together, along with the 1st, 3rd, 5th, and 7th digits of the original number.
    4. Subtract this sum from the next highest multiple of 10.
    5. The difference should be equal to the 9th digit, which is considered the check digit.
    Example of validating S.I.N. 765932546
    1st digit 7
    2nd digit (6*2 =12 1+2=) 3
    3rd digit 5
    4th digit (9*2 = 18 1+8 =) 9
    5th digit 3
    6th digit (2*2 = 4) 4
    7th digit 5
    8th digit (4*2 = 8) 8
    Total 44 next multiple of 10 is 50
    50-44 = 6 which is the 9th digit
    Therefore the S.I.N. 765932546 is Valid
    ********* SIN Validation *********
    Welcome - Please enter the first number: 120406780
    Second digit value multiplied by 2 4
    Fourth digit value multiplied by 2 8
    Sixth digit value multiplied by 2 12
    Eighth digit value multiplied by 2 16
    Value derived from 6th digit 3
    Value derived from 8th digit 7
    The total is 30
    Calculated digit is 10
    Check digit must be zero because calculated value is 10
    The SIN 120406780 is Valid
    this is my assignemtn this is what i have! i dont know where to start! please help me!
    /*     File:     sinnumber.java
         Author:     Ashley
         Date:     October 2006
         Purpose: Lab1
    import java.util.Scanner;
    public class Lab1
              public static void main(String[] args)
                   Scanner input = new Scanner(System.in);
                   int sin = 0;
                   int number0, number1, number2, number3, number4, number5, number6, number7, number8;
                   int count = 0;
                   int second, fourth, sixth, eighth;
                   System.out.print("\t\n**********************************");
                   System.out.print("\t\n**********SIN Validation**********");
                   System.out.print("\t\n**********************************");
                   System.out.println("\t\nPlease enter the First sin number: ");
                   sin = input.nextInt();
                   count = int.length(sin);     
                   if (count > 8 || count < 8)
                   System.out.print("Valid: ");
         }

  • Wanted: Help with thread in spanish; guitar not recording

    Can someone please help with this thread?
    GarangeBand No Reconoce Mi Guitarra Audio
    The op has trouble to connect his guitar. I cannot interview him in spanish, and he does not know to ask in English.
    Appriciate any help.
    Léonie

    Hi Borris12,
    I'll clear this up for you and let you know whats happened.
    Could you drop me in an email please with your BT account and telephone number along with a link back to this thread.
    Just send to the email address in my profile and mark FAO Craig please.
    Thx
    Craig
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)”
    td-p/30">Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Need help with long term Java problems

    I've been having problems with Java on my computer for about a year now, and I'm hoping that someone here can help me out.
    Java used to work fine on the computer when I first got it (a Dell laptop) and I hadn't installed anything myself. But then one day it stopped loading Java applets, and hasn't worked since. By this, I mean that I get the little colorful symbol in a box when I try to play Yahoo games, use the http://www.jigzone.com site, go to chat rooms, etc. Java menus on websites like http://www.hartattack.tv used to work still, but lately they've been giving me that symbol too.
    I've tried downloading a newer version of Java, but nothing I do seems to work, and I don't know of anything I did to trigger it not working. I'm hoping there's a simple solution to this, and I'm just dumb.
    Thanks.

    This might be way off, but it's something that's tripped me up in the past:
    If you are using Sun's Java plugin, the first time you go to a site that has a particular Java applet, you may be asked to approve/reject a security request.
    If you have clicked on any other windows while the request is first being loaded (which can take some time, because this is swing based), then the security dialog box does not pop to the top of the window stack, and doesn't add an entry into the task bar.
    It appears that Java just doesn't work, but it's actually waiting for you to click "Yes". You can check this by hitting alt-tab and seeing if the Java coffee cup icon is one of the options.
    - K

  • Help with JAI in java applet

    I'm fairly inexperienced with java, but I'm hopeful someone here won't mind helping.
    I am using netbeans and have a project to let a user upload files or scan them in with a usb scanner. I've imported icepdf to the libraries and referenced it in the jnlp file and it worked fine. I did the same with jai_windows-i586.jar and I get this error when trying to upload
    Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: com/sun/media/jai/codec/SeekableStream
    Caused by: java.lang.ClassNotFoundException: com.sun.media.jai.codec.SeekableStream
    I expanded the jar file and found it contained an exe. jai-1_1_3-lib-windows.i586.jre.exe. I found that if I run that exe [(found here)|http://download.java.net/media/jai/builds/release/1_1_3/] on any pc locally, I will not get the errors on that pc.
    Am I referencing it incorrectly?
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" max-heap-size="1024m" />
    <jar href="ScanAreaUI.jar" main="true" />
    <jar href="icepdf-core.jar"/>
    <jar href="jai_windows-i586.jar"/>
    <nativelib href="JTwain-Native.jar" />
    </resources>
    Do I need to make the applet install the exe located in the jar? I've tried to find information on how to do that without much luck so far.
    Thanks for any advice/help.

    If it's not finding your "exe" file, then you have an OS path problem. You can either change your path variable in Windows or you can move that "exe" to a location where you already have a path defined. You do realize that when you use features of JAI that are not incorporated in to the JDK, you'll have to have the JAI package loaded on every machine you ever want to run your project.

Maybe you are looking for

  • Charging my macbook in the car (additional question)

    Hello so i have been researching charging my macbook in the car and something that a few people have brought up is using an AC/DC converter that plugs into the cigarette plug to charge their laptop. This seems like a much cheaper method, but i was wo

  • Select Into statement in db function - query from granted schema table

    problem with "select into" in db function in 10.2 There are two schemas. 'mdbdev' is the master database and 'devusr' is granted SELECT table access to execute queries in mdbdev schema. with devusr, in SQL, I'm able to execute the following query sel

  • Apple mobile device failed to start while installing i tunes

    cannot download itunes on pc. keeps coming up with apple mobile device failed to start

  • Assets in Presentation Display Too Quickly

    One of our presentations has assets that only display for 6-8 seconds, though they are scheduled to display for 9 or 12 seconds.  The presentation is set up such that 50 individual slides are in an All-Media playlist.  We are in version 5.2.2, using

  • Project Systems

    Is there a separate forum for Project Systems? Where does PS functional people discuss? I would like to make some changes to a report(12KST1C) which is in project systems. Is there someone to help me? Please advice In transaction CJE0 - if I choose t