Is it possible to pass files as arguments to executable jars in windows?

Hi,
I've searched through the forums a bit and couldn't find any good info... basically, I'd like a user of my jar file to be able to drag and drop a file onto my jar file, and have the jar file process that file.
Anyone know if this is possible? I'd like to have all the configuration done on my side, so that the users don't have to set up/modify their file extension -> program associations...
I'm also looking into writing a DOS batch file to do that... but I guess that would be off-topic for this forum.
Thanks in advance,
KaJun

Currently, Oracle 9iFS does not support referencing files
with a BFile column. All files are stored as BLOBs.
It would help us plan our future releases if you would explain
why you wish to use BFile and keep your file content outside of
the database.

Similar Messages

  • Pass Files As Arguments

    I have several files and want to pass them as arguments to a Helper class for further processing. I put the public static void main (String arg[]) {} class and the Helper class in a package.
    I got error messages "cannot resolve symbol" for:
    1. variable XSLTransformHelper for if (!XSLTransformHelper.transform(xmlin, xslin, htmlout))
    2. method close() for xmlin.close();
    3. method close() for xslin.close();
    4. method close() for htmlout.close();
    I cannot spot the problems and my code can be seen below:
    =====================================
    package Transform;
    import java.io.*;
    public class XSLTransform {
    public static void main(String[] args) throws Exception {
    //Create a file object with the file name in the argument:
    File xmlin = new File("c:/javaprj/RSS.xml");
    File xslin = new File("c:/javaprj/RSS.xsl");
    File htmlout = new File("c:/javaprj/RSS.html");
    if (!XSLTransformHelper.transform(xmlin, xslin, htmlout))
    System.err.println("Transformation failed");
    else
    try {
    xmlin.close();
    xslin.close();
    htmlout.close();
    catch(IOException e)
    {System.out.println("closing file exception");}
    =======================================================
    =======================================================
    package Transform;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    public class XSLTransformHelper {
    public static boolean transform(String xmlFilename, String xslFilename, String resultFilename) {
    try {
    TransformerFactory factory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileInputStream(xmlFilename));
    Source xslSource = new StreamSource(new FileInputStream(xslFilename));
    Transformer transformer = factory.newTransformer(xslSource);
    Result result = new StreamResult(new FileOutputStream(resultFilename));
    transformer.transform(xmlSource, result);
    return true;
    } catch (TransformerFactoryConfigurationError transformerFactoryConfigurationError) {
    transformerFactoryConfigurationError.printStackTrace();
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    } catch (TransformerException e) {
    e.printStackTrace();
    return false;
    ======================================================

    I have several files and want to pass them as
    arguments to a Helper class for further processing. I
    put the public static void main (String arg[]) {}
    class and the Helper class in a package.
    I got error messages "cannot resolve symbol" for:
    1. variable XSLTransformHelper for if
    (!XSLTransformHelper.transform(xmlin, xslin,
    htmlout))
    2. method close() for xmlin.close();
    3. method close() for xslin.close();
    4. method close() for htmlout.close();
    I cannot spot the problems and my code can be seen
    below:
    =====================================
    package Transform;
    import java.io.*;
    public class XSLTransform {
    public static void main(String[] args) throws
    ws Exception {
    //Create a file object with the file name in the
    n the argument:
    File xmlin = new File("c:/javaprj/RSS.xml");
    File xslin = new File("c:/javaprj/RSS.xsl");
    File htmlout = new File("c:/javaprj/RSS.html");
    if (!XSLTransformHelper.transform(xmlin, xslin,
    slin, htmlout))
    System.err.println("Transformation failed");
    else
    try {
    xmlin.close();
    xslin.close();
    htmlout.close();
    catch(IOException e)
    {System.out.println("closing file
    losing file exception");}
    =======================================================
    =======================================================
    package Transform;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    public class XSLTransformHelper {
    public static boolean transform(String
    ing xmlFilename, String xslFilename, String
    resultFilename) {
    try {
    TransformerFactory factory =
    y factory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new
    mSource(new FileInputStream(xmlFilename));
    Source xslSource = new StreamSource(new
    mSource(new FileInputStream(xslFilename));
    Transformer transformer =
    ansformer = factory.newTransformer(xslSource);
    Result result = new StreamResult(new
    mResult(new FileOutputStream(resultFilename));
    transformer.transform(xmlSource, result);
    return true;
    } catch (TransformerFactoryConfigurationError
    onError transformerFactoryConfigurationError) {
    transformerFactoryConfigurationError.printStackTrace()
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    } catch (TransformerException e) {
    e.printStackTrace();
    return false;
    ======================================================I observe that you pass Files as arguments of the method transform while this method is expecting Strings!!!!

  • Finding a file in the current executable jar file.

    Hi all,
    I am writing a little command line type application and I thought it would be neat to embed it's 'help file' into it's executable JAR file.
    Please can someone show me how to code my application to extract a file from the JAR file from which the Main.class also came?
    (Is that possible?)
    I've been looking around, I can find out how to work with a different JAR file but NOT how to examine the currently 'executing' one.
    Many thanks,
    - jon.

    Excellent! Thank you very much. It's easy when you know how. This works a treat!:
         private static void printHelp() {
              InputStream helpFile = Misql.class.getClassLoader().getResourceAsStream("doc/MISQLhelp.txt");
              if (helpFile == null) {
                   _out.println("Help file: doc/MISQLhelp.txt not found.");
                   return;               
              try {
                   int c;
                   while ((c = helpFile.read()) != -1)
                        _out.write(c);
                   helpFile.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return;
         }

  • Passing files into BPEL processes

    Hi,
    I was wondering if it is possible to pass files of different types (.doc, .jpg etc.) into a BPEL process. If so, are there any documentation and/or examples showing how to do this?
    Thanks

    in 2.0.11, the only way to pass files to BPEL processes is to use base64 encoding.
    we are looking at providing better support for binary attachment in the 10.1.3 Preview 1 release scheduled for March 05.
    Best,
    Edwin

  • How to Read all files inside resource Folder inside Jar?

    I have a Jar file,,,, The program reads for resource files in the resource folder inside the Jar. I want my program to read all files inside this folder without knowing the names or the number of files in the folder.
    I am using this to make an Applet easy to be updated with spicific files. I just want to add a file inside the resource folder and Jar the program and automatically the program reads what ever is in there!!
    I used the File class to get all file names inside the resource folder. it works fine before Jarring the program. After I jar I recieve a URI not Herarichy Exception!!
    File fold=new java.io.File(getClass().getResource(folder).toURI());
    String[] files=fold.list();
    I hope the question is clear!!

    How to get the directory and jar file that you class resides in:
    // returns path and jarfile (ex: /home/mydir/my.jar)
    public String getJarfileName()
            // Get the location of the jar file and the jar file name
            java.net.URL outputURL = YourClass.class.getProtectionDomain().getCodeSource().getLocation();
            String outputString = outputURL.toString();
            String[] parseString;
            int index1 = outputString.indexOf(":");
            int index2 = outputString.lastIndexOf(":");
            if (index1!=index2) // Windows/DOS uses C: naming convention
               parseString = outputString.split("file:/");
            else
               parseString = outputString.split("file:");
            String jarFilename = parseString[1];
           return jarFilename;
    }If your my.jar was in /home/mydir, it will store "/home/mydir/my.jar" in jarFilename.
    note: getLocation returns "file:/C:/home/mydir/my.jar" for Windows/DOS and "file:/home/mydir/my.jar" for windows, thus why I look for the first and last index of the colon so I can correctly split the string.
    If you want to grab a file in the jar file and get an InputStream, do the following:
    import java.io.*;
    import java.util.Enumeration;
    // jar stuff
    import java.util.jar.*;
    import java.util.zip.ZipEntry;
    public class Jaris
       private JarFile jf;
       public Jaris(String jarFilename) throws Exception
           try
                           jf = new JarFile(jarFilename);
           catch (Exception e)
                jf=null;
                throw(e);
       public InputStream getInputStream(String matchString) throws Exception
           ZipEntry ze=null;
           try
              Enumeration resources = jf.entries();
              while ( resources.hasMoreElements() )
                 JarEntry je = (JarEntry) resources.nextElement();
                 // find a file that matches this string from anywhere in my jar file
                 if ( je.getName().matches(".*\\"+matchString) )
                    String filename=je.getName();
                    ze=jf.getEntry(filename);
          catch (Exception e)
             throw(e);
          InputStream is = jf.getInputStream(ze);
          return is;
       // for testing the Jaris methods
       public static void main(String[] args)
          try
               String jarFilename=getJarfileName();
               Jaris jis = new Jaris(jarFilename); // this is the string we got from the other method listed above
               InputStream is=jis.getInputStream("myfile.txt"); // can be used for xml, xsl, etc
          catch (Exception e)
             // this is just a test, so we'll ignore the exception
    }Happy coding! :)
    Doc

  • Photoshop .psd files converted to Unix Executable files

    I'm an illustrator and I store my art on CDs and DVDs. After a period of time my files are converted from Photoshop .psd files to Unix Executable files and I can't open them. What can I do to get my work back??? -and keep this from happening in the future. Why does it do this????
    Thanks for any help.

    The file sizes range from 22.2 MB to 67.9 MB.
    Size isn't the issue then. Linc was asking that question because we see that with other file types. Older fonts in particular, which have all of their data in the resource fork. If that gets stripped, you end up with a zero byte file.
    Does that mean I'll have to go through the Adobe authorization process for Photoshop again?
    If the version of Photoshop you're currently using is already activated, then no. Either way, it has nothing to do with .psd files showing as UNIX executables.
    In Windows, any file that doesn't have an association to a program is displayed as a white, dog-eared piece of paper with the Windows logo in the middle. That's Windows' way of saying, "I have no idea what this is." In OS X, (except for those files which actually are UNIX executables), displaying them as such is OS X's way of saying the same thing.
    I thought I was home free when the icon changed to a thumbnail picture of the illustration, but PS refuses to open it saying it is not a Photoshop file. ???
    Now that is weird. As of Snow Leopard, Apple put the old Type and Creator codes to rest. It will read them as a last resort to try and identify an older file, but none of Apple's applications add them to any file they save. For better compatibility with Windows, and OS X's own underlying UNIX core, file extensions have taken their place. So adding a .psd extension should have worked. Without playing with one of your files, I couldn't tell you why Photoshop declared it wasn't a valid .psd image.
    On a side note, Apple added Uniform Type Identifiers to OS X to keep things separate. A big problem in Windows is that multiple apps may use the same file extension. EPS is a big one in printing. So you have Photoshop, Illustrator, Freehand, Quark and others all using .eps for Encapsulated PostScript files. However, Windows can only associate one application to any given extension. So if Illustrator happens to be the one tagged to .eps files, it will try to open any file ending in .eps, no matter what program actually created it. OS X keeps them separate with Uniform Type Identifiers. So even though multiple files may have .eps file extensions, the extra metadata keeps track of what program it actually belongs to.
    This is what is part of the LaunchServices database, and was why it was my first suggestion. If that database is wonky, you'll see weird things like this. Have you tried clearing it yet?
    The files are fine when newly burned to CD. It is only months, or years, later that they become Unix Executable Files.  This has happened to just about all of my CD backups and it's frustrating to think that CD backup doesn't work across newer OSs and Photoshop upgrades. I suspect that may be the problem, but it just shouldn't happen.
    That shouldn't make a difference. I've got a bunch of very old files created in Photoshop back from OS 8 on CD. No file extensions, as nothing did at the time. Just Type and Creator codes. They all open fine in PS CS5.5 in Snow Leopard, though the native Photoshop files do need to have a .psd extension added.

  • Cannot make executable jar file for swt application

    hi to all!!! i have started learning swt library and it seems nice to me, but i have one problem, i cannot run my application. The problem is that i cannot make executable jar for it.
    i'm using ecilpse_3.1.2 and have pluggined the visual editor for swt! yesterday i found one topic where was described the process of making the swt executable jar, i followed the instructions in the topic, but didn't resolve my problem, so if anybody knows how to achieve this , please help!!!!!!
    the instructions in the mentioned topic are :
    1. Make sure the SWT jar file is included in the Eclipse project build path
    a. Download the standalone SWT jar file from eclipse.org even if you already have the ones that come with Eclipse. It is called ?swt.jar? and you will package it with the executable JAR. Make sure it is the same version of SWT that you used to make your program.
    b. In Eclipse, import swt.jar via Project Properties::Java Build Path::Libraries::Add External JARs. (Make sure to include the source .zip file). Also make sure to select the swt package in the ?Order and Export? tab.
    c. At this point, you should be able to compile and run your SWT application in the Eclipse SDK.
    2. Do a standard Eclipse jar file export
    a. Right click on the main .java project file and select ?Export??.
    b. Choose ?JAR File? from the list.
    c. Select the relevant packages and .classpath and .project resource files
    d. Make sure ?Export generated class files and resources? is selected and browse to the location where you want the JAR file to be created.
    e. Specify ?Generate the manifest file? and don?t seal the JAR or any packages. Choose the class containing the main method as the ?Main class?.
    3. Change the manifest file
    a. Navigate to the JAR file you created and open it with WinZip.
    b. Open the MANIFEST.MF file inside and copy the contents.
    c. Create a new file called ?MANIFEST.MF? and paste in the contents of the old manifest file.
    d. Add the line ?Class-Path: <swt jar file path>?. For simplicity, you can just keep a copy of the swt.jar file in the same folder as the executable jar, in which case, the line is ?Class-Path: swt.jar?. Make sure there is a carriage return after the last line in the manifest file, or that line will not be parsed.
    4. Replace the manifest file
    a. Make sure the manifest file and the executable jar are in the same folder.
    b. Open the command prompt and navigate to the containing folder.
    c. Enter the command ?jar umf MANIFEST.MF <executable jar name>? to update the manifest file with the class path information.
    5. Package the JAR with SWT files
    a. Put the updated executable JAR file, swt.jar, and the associate DLL in the same folder. The DLL can be pulled out of swt.jar and should have a name like ?swt-win32-####.dll? on Windows.
    b. The JAR file should now successfully execute. On Windows, you can usually just double click the JAR file in explorer and it will open. If that does not work, the command ?java ?jar <executable jar name>? on the command line has the same effect.
    but a few steps aren't exact for me , for example : first, which jar i have to include in build path : downloaded or from plugins folder, second
    i have to incude source.zip too??? but it is only in downloaded zip file which includes both swt.jar and src.zip, and finally can anyone clarify next :
    "5. Package the JAR with SWT files
    a. Put the updated executable JAR file, swt.jar, and the associate DLL in the same folder. The DLL can be pulled out of swt.jar and should have a name like ?swt-win32-####.dll? on Windows."
    what does this mean, put these in folder or make jar from them????

    wolve634 wrote:
    but a few steps aren't exact for me , for example : first, which jar i have to include in build path : downloaded or from plugins folder, secondTry it both ways. If neither works, then ask again. In a suitable forum, though. An Eclipse forum or an SWT forum or something related to where you got those instructions would make a lot more sense than asking here.
    i have to incude source.zip too???No, of course you don't have to distribute the source code.
    a. Put the updated executable JAR file, swt.jar, and the associate DLL in the same folder. The DLL can be pulled out of swt.jar and should have a name like ?swt-win32-####.dll? on Windows."
    what does this mean, put these in folder or make jar from them????It says "Put (them) in the same folder". You're asking whether that means to put them in a folder? Yes, it does.

  • Is it possible to pass an argument to the function triggered by an event handler?

    Hello All,
    Trying to migrate my way of thinking from AS2 to CS4/AS3.
    Ok, I have 2 buttons on the stage. Each button does almost
    the same thing, so I want to create a single function, and each
    button calls that same function (we'll name that function
    "Navigate")... however, the function will need to end up doing
    something different dependant on which button was clicked.
    So, previously, in AS2, I would've added some code onto the
    buttons themselves with on(release) methods (see CODE EXAMPLE 1)
    So, each button effectively calls the Navigate function, and
    passes a different frame label to the function.
    Now, I'm trying to recreate this functionality in AS3. As you
    all know, on(release) has been done away with (still don't know
    why), but we now have to use event handlers, so I'm trying to
    figure out a way to pass a different frame label argument to the
    Navigate function. Currently I can achieve that by using a switch
    statement to test which button was clicked, and act accordingly
    (see CODE EXAMPLE 2).
    In this over-simplified example, this works fine, but in the
    real world I'm going to have more than 2 buttons, and the Navigate
    function would probably be much more complicated...
    So, I would like to be able to pass an argument(s) (like in
    the AS2 example) to the Navigate function... perhaps in the
    addEventListener() method? I tried this, but got compiler errors
    (see CODE EXAMPLE 3):
    The Million Dollar Question:
    Is it possible to dynamically pass/change an argument(s) to a
    function which is triggered by an event listener? (Or is the event
    that triggered the function the only argument you can have?)
    If this isn't possible, I'd greatly like to hear how you
    folks would handle this (other than having a switch statement with
    12 cases in it)???

    I've found a couple solutions that I'll post below for
    prosperity...
    You could create a Dictionary keyed by the prospective event
    targets and store any information in there you want associated with
    them. Then the navigate function can check that dictionary to get
    it's parameters:
    // Code //
    Button1.addEventListener(MouseEvent.CLICK, Navigate, false,
    0, true);
    Button2.addEventListener(MouseEvent.CLICK, Navigate, false,
    0, true);
    var buttonArgs:Dictionary = new Dictionary();
    buttonArgs[Button1] = "FrameLabel1";
    buttonArgs[Button2] = "FrameLabel2";
    function Navigate(e:MouseEvent):void{
    gotoAndStop(buttonArgs[e.target]);
    This in my eyes, is about the same amount of work as writing
    a long switch statement, but a little more elegant I suppose.
    I had a little trouble understanding the next solution,
    because I didn't quite understand an important piece of information
    about event listeners. The addEventListener () requires a Function
    as the 2nd argument passed to it.
    It didn't quite click until someone pointed it out to me:
    Navigate is a Function...
    Navigate("FrameLabel1") is a Function
    call...
    So by writing just
    Navigate, I'm not actually calling the function at the time
    of the addEventListener call, I'm just supplying the event listener
    with a reference to the name of the function. Then, when the
    listener is triggered, the listener will call (and pass a
    MouseEvent argument to) the Navigate function.
    Conversely, by writing
    Navigate("FrameLabel1") as the 2nd argument, the event
    listener trys to execute the Navigate function at the time the
    addEventListener is instantiated. And, since, in this example, the
    Navigate function returned as ":void" a compile error would occur
    because as I stated, an event listener requires a Function data
    type as the 2nd argument. This would basically be like writing
    addEventListener(MouseEvent.Click,
    void, false, 0, true)
    However, there is a way around this... basically, instead of
    defining the Navigate function as returning a void data type, you
    define it as returning a Function data type, and then nest another
    function (which actually contains the actions you want to perform)
    inside of it.
    Button1.addEventListener(MouseEvent.CLICK,
    Navigate("FrameLabel1"), false, 0, true);
    Button2.addEventListener(MouseEvent.CLICK,
    Navigate("FrameLabel2"), false, 0, true);
    function Navigate(myLabel:String):Function{
    return function(evt:MouseEvent):void{
    gotoAndStop(myLabel);

  • Pass XML in argument tag in JNLP file

    Is there a way to pass an xml string in the <argument> tag. I tried to do it but I get xml parsing error. It seems that the xml becomes the child node when I pass that to the arguments tag. the CDATA also does not work. Has anyone done this successfully. thanks
    I am trying to pass somthing like
    <argument><Settings><URL>http://xxx.com</URL></Settings></argument>
    this is just an example I have also tried
    <argument>"<Settings><URL>http://xxx.com</URL></Settings>"</argument>
    this also errors out.
    <argument><![CDATA[<Settings><URL>http://xxx.com</URL></Settings>]]</argument>
    that does not work too.
    Please let me know if there is anything else I can try

    I've successfully used CDATA to embed HTML in an argument, on JDK 1.5 at least (not tried on others yet).
    Your CDATA closing section should be: ]]> Yours is missing the end bracket - if that's not an error in your post it's probably the cause of the XML parsing error.

  • Is there a way to pass files to a LV app in Mac OS X?

    There is an option in the Finder in Mac OS X to open files with the specified application. I tried it with my LV app, but unfortunately I haven't found any way to read out the filename passed to the app.
    (The Application/Command Line Arguments Property didn't work in this case.)
    Has anyone ever tried to pass files to a LV app in Mac OS X? I mean not in the command line but in the Finder.
    Thanks in advance

    Hi,
    When I understand this right - and as I am not so much of a MAC Expert - you want to do the following:
    1. You are in a file finder, where you can click on files an select: "open with ProgrammXY"
    2. That ProgrammXY should  be a LabVIEW App you created that can open files for Analysis.
    3. The LabVIEW App catches from somewhere the path-string and name of the file that was selected to be opened with your LabVIEWApp, like from some
    kind of property node or function.
    4. How to do that?
    I do not think that is possible, at least I do not know a way to do that in Windows so I doubt there is a way to do that in MAC OS.
    <<Anyway, it could even be an empty App, the main question is if it is even possible to get the filename in a LV App if we open it in Finder.
    When you cannot configure the Finder in a way so that he writes the file name as a command line parameter in the opening call .- exuse me if that is not MAC vocabulary - I do not see a way how to do this.
    Regards
    René

  • How to run jar files with arguments?

    Hi everybody,
    Is it possible to run a jar file with arguments passed to its MAIN class?
    If yes can you help me on how to do it?
    Thanx

    I am in complete agreement with FahleE. I'll refine it a bit.
    On my machine (running RedHatLinux8.0) you can run the demos like this.
    1. open a console window
    2. go to the directory where the demo you wish to run, say, demo.jar, is located
    for instance for the SwingSet2-demo
    cd /usr/lib/java/demo/jfc/SwingSet2
    3. run the jar file
    java -jar demo.jar
    In order to run it windows style, ie, launching by double clicking, save these lines in a file called
    LaunchJar.sh
    cd /usr/lib/java/demo/jfc/SwingSet2
    java -jar demo.jar
    where demo.jar is the jar file you want to run.
    Right click on the LaunchJar.sh and go to the 'Properties' tab. Check the 'Execute' permissions for Owner/groups/others. You can also do the same thing by chmod command.
    Now double-click on the LaunchJar.sh file: your application should be launched.
    Palash.
    Please Note: It is important to set the path variable to your JAVA_HOME directory....
    Otherwise, instead of
    java -jar demo.jar, you will need to use the full path to your JAVA_HOME/bin directory like:
    JAVA_HOME/bin /java -jar demo.jar.
    Where JAVA_HOME is the directory where you have installed java. Typically it is usr/java or usr/local/java

  • Passing files in automator to a terminal command?

    I would like to know if something is possible: I've used automator to sort through a large number of files for specific traits using the 'Filter Finder Items' action. Can I then pass these files, one by one, into a terminal command?
    Specifically, I have a bunch of markdown files that I want to run through the markdown command in the terminal.
    Thanks for any help,

    automator has "run shell script" action. just add that action to the end of your wrokflow with the option to pass input as arguments.

  • Is possible to pass array/list as parameter in TopLink StoredProcedureCall?

    Hi, We need to pass an array/List/Vector of values (each value is a 10 character string) into TopLink's StoredProcedureCall. The maximum number of elements on the list is 3,000 (3,000 * 10 = 30,000 characters).
    This exposed two questions:
    1. Is it possible to pass a Vector as a parameter in TopLink's StoredProcedureCall, such as
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    Vector strVect = new Vector(3000);
    strVect.add(“ab-gthhjko”);
    strVect.add(“cd-gthhjko”);
    strVect.add(“ef-gthhjko”);
    Vector parameters = new Vector();
    parameters.addElement(strVect);
    session.executeQuery(query,parameters);
    2. If the answer on previous question is yes:
    - How this parameter has to be defined in Oracle’s Stored Procedure?
    - What is the maximum number of elements/bytes that can be passed into the vector?
    The best way that we have found so far was to use single string as a parameter. The individual values would be delimited by comma, such as "ab-gthhjko,cd-gthhjko,ef-gthhjko..."
    However, in this case concern is the size that can be 3,000 * 11 = 33, 000 characters. The maximum size of VARCHAR2 is 4000, so we would need to break calls in chunks (max 9 chunks).
    Is there any other/more optimal way to do this?
    Thanks for your help!
    Zoran

    Hello,
    No, you cannot currently pass a vector of objects as a parameter to a stored procedure. JDBC will not take a vector as an argument unless you want it to serialize it (ie a blob) .
    The Oracle database though does have support for struct types and varray types. So you could define a stored procedure to take a VARRAY of strings/varchar, and use that stored procedure through TopLink. For instance:
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    oracle.sql.ArrayDescriptor descriptor = new oracle.sql.ArrayDescriptor("ARRAYTYPE_NAME", dbconnection);
    oracle.sql.ARRAY dbarray = new oracle.sql.ARRAY(descriptor, dbconnection, dataArray);
    Vector parameters = new Vector();
    parameters.addElement(dbarray);
    session.executeQuery(query,parameters);This will work for any values as long as you are not going to pass in null as a value as the driver can determine the type from the object.
    dataArray is an Object array consisting of your String objects.
    For output or inoutput parameters you need to set the type and typename as well:
      sqlcall.addUnamedInOutputArgument("PERSON_CODE", "PERSON_CODE", Types.ARRAY, "ARRAYTYPE_NAME"); which will take a VARRAY and return a VARRAY type object.
    The next major release of TopLink will support taking in a vector of strings and performing the conversion to a VARRAY for you, as well as returning a vector instead of a VARRAY for out arguments.
    Check out thread
    Using VARRAYs as parameters to a Stored Procedure
    showing an example on how to get the conection to create the varray, as well as
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html on using Varrays in Oracle, though I'm sure the database docs might have more information.
    Best Regards,
    Chris

  • Is it possible to pass some type of parameter/unique id FROM PDF?

    hi there,
    I will try to explain this as best as I can but please bear with me.
    I have Adobe Acrobat X Pro.
    We have drawings linked to each other in pdf.
    When you open a drawing (say, a layout of a house), my boss wants to be able to click on say, a door, and have all the information on that door pop up (size, manufacturer, when it was shipped, etc). The information log is stored in Excel. I know how to hyperlink to open an excel file FROM pdf, but cannot figure out how to open a specific sheet in Excel. So here is my question:
    1. How do I link to a specific sheet in Excel so it opens when I click on a link in the pdf file?
    Having said that, we are going to have around 1500 items and I don't want to have to create 1500 sheets (if that's even possible) to open the details for each one. So here is question #2:
    2.  Is it possible to pass some type of parameter to excel (or even Access) to know what item was clicked on the pdf file so I can write a macro/code in Excel to just fill in the details for that item? (Hence just needing one sheet instead of 1500?).
    Suggestions/path forwards are welcome.
    I hope this was clear and I thank you in advance.
    Thanks,
    Jessica

    There really isn't a way to do that. It would be possible to export an Excel sheet to a tab-delimited (or CSV, XML) file which could optionally be attached to the PDF. JavaScript inside the PDF could read the data file and extract the information for an item so it could be displayed somehow.

  • Main-args in executable Jar file. Possible?

    Hello all!
    Is it possible to specify arguments for the main class of an executable jar file?
    If you call it on the command line this might be possible but what to do if you start the jar with double click?
    Any chance?

    i don't think so, see http://java.sun.com/docs/books/tutorial/jar/basics/mod.html

Maybe you are looking for