How can I run a a class file on the Apache server?

Hi Guys and Gurus,
I am seeking some favor all of experienced gurus, i.e.
How can I run a a class file on the Apache server?
Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
Please advise...
VJ

cross posted
http://forum.java.sun.com/thread.jsp?thread=299137&forum=31&message=1184025

Similar Messages

  • URGENT PLEASE:How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server? Can I run through an Applet?
    How can I set Environment variables in Windows2000 Professional Environment?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    The code is here
    import java.sql.*;
    public class RecordShow {
    public static void main(String args[]) {
    String url = "jdbc:mysql://localhost/myhost";
    Connection con;
    String query = "select mytable.column," +
    "from mytable " +
    "where mytable.column = 1";
    Statement stmt;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url,
    "myuser", "mypassword");
    stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    int rowCount = 1;
    while (rs.next()) {
    System.out.println("Row " + rowCount + ": ");
    for (int i = 1; i <= numberOfColumns; i++) {
    System.out.print(" Column " + i + ": ");
    System.out.println(rs.getString(i));
    System.out.println("");
    rowCount++;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Please advise... THANKS
    VJ

    Ehm, I wasn't referring to you at all... read up,
    there's a comment by jschell saying that CGI might be
    easier/better for his purposes.
    Yep.
    I know PHP/Perl/whatever might be easier for some
    purposes, but only if you happen to know them and want
    to/are able to use them. Ok. But you aren't the one asking the question are you. And the person who asked the question seems to have absolutely no familiarity with Apache or applets.
    So whatever they do they are going to have to learn a lot.
    And that does indeed suggest that in all likelyhood they have not investigated the alternatives.
    And for the vast majority of internet applications, especially with smaller projects (obvious this person is not working with a large team), using perl, or something besides java, is going to be the best business solution. It is simpler, and more secure (probably due to the fact that it is simpler.)
    Since this is a Java forum, I
    answer under the assumption that people have made a
    choice one way or another to use a Java solution to
    their problem, so I try to solve it in Java first, and
    only when that fails (very seldom) do I turn to other
    solutions.You approach problems by arbritrarily deciding to try to solve it in java first and only if you fail do you then look to other solutions?
    My first step is to try to figure out which of the various avenues is going to cost less. (And a secondary, but non-trivial concern, is then to convince the customer that just because they have heard of a buzz word like 'enterprise bean' that it doesn't mean that is a cost effective solution.) We must come from different worlds.

  • How can i run a java class file from shell?

    Hi all,
    I've a .class file named "File" that contains Main method, it is in the package "File2".
    How can I run it by shell command?
    PS: "java -cp . file" doesn't work it launch->
    Exception in thread "main" java.lang.NoClassDefFoundError: File2/File (wrong name: File2/File)
    Thanks in advance.

    Just to understand: is File2 ar jar archive or not? If it is a jar archive, have you tried open File2.jar? If File2 is a directory within the current directory, have you tried java -cp . File2/File? I just tested with a set of classes and it works... Let me be precise:
    * Let us imagine you are working in a directory whole path is PathToDir/
    * in this directory you have the classes put in a directory called File2
    * in order to launch File.class then you would have to invoke :
    cd PathToDir/ (just to be sure)
    java -cp . File2/File
    *if you were to do the following then you would have the problem you describe
    cd PathToDir/File2/
    java -cp . File

  • How can I run a SQL script file...

    How can I run a SQL script file from a location on my computer without providing the whole path?
    Is there some way I can set a "Working folder" in SQL Plus??
    Thanks!
    Tom

    You can create an environment variable called "SQLPATH" which is a list of directories that SQL*Plus will search for your .SQL
    scripts.
    I would like to use another directory than the oracle/bin...
    How can I do this ??
    Hello,
    U can do this by this way:
    Save odm_script.sql file to the default Oracle
    directory i.e. Oracle-Home/bin and Run following command
    through SQL Plus.
    SQL>@Script_Name
    I hope this will resolve ur problem.
    Regards,
    Omer Saeed Khan.

  • Email attachments: whenever someone sends me a file the Ipad labels it winmail.dat and wont allow me to open it...these are Word, Exce or jpgs.  Does anyone know why this is and how to fix it?  Also, how can you save attachments to a file on the IPad2

    whenever someone sends me a file the Ipad labels it winmail.dat and wont allow me to open it...these are Word, Exce or jpgs.  Does anyone know why this is and how to fix it?  Also, how can you save attachments to a file on the IPad2

    Is this a particular sender, or all of your attchments?  Google winmail.dat and you will see a number of returns that can explain this, but in short, this is the way some e mail providers deal with attachments.  If all of your e mail is coming that way, you need to change a setting on your isp set up.  Perhaps stary here...
    http://www.nytimes.com/2010/11/25/technology/personaltech/25askk.html

  • HT4910 How can I backup my Quicken Essentials files to the Cloud?

    How can I backup my Quicken Essential files to the Cloud?

    Use the camera icon in the header for your post to insert the picture.
    My other question?
    What is the file's extension (in the folder on your Mac?)
    Is it a .dmg?

  • How do I setup permission to transfer files to the MacMini Server. I thought I had it setup to do such but apparently not as I get an error message?

    How do I setup permission to transfer files to the MacMini Server. I thought I had it setup to do such but apparently not as I get an error message that I don't have permission?

    Both the Mac and Windows units we are usinghave connectivity to the MacMiniServer (on the same network) to open and edit files but cannot transfer new files to the MacMini. FileSharing is on. I went to File Sharing on the MacMini and added the appropriate users and checked FileSharing. Is there something else I needed to do?

  • How can I run a labview executable file inside a VI

    How can i add and run a labview executable file inside the vi and grab the output of the executable file to be used in the vi?
    mytestautomation.com
    ...unleashed the power, explore and share ideas on power supply testing
    nissanskyline.org
    ...your alternative nissan skyline information site

    Hi cmdrb,
    to run an executable you use SystemExec function.
    To get the output of your (LabVIEW-made) executable you need to program some data transfer means: you may use network functions or file functions. In both cases your "LabVIEW executable" needs to provide that options…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can i run java windows(class) app. from studio creator

    Hi experts,
    I want to run windows application(which write with java and compile javac, i have got *.class) from studio creator.
    For example;
    import java.awt.*;
    import java.awt.event.*;
    public class IlkPencere implements WindowListener,ActionListener
    public Frame p1;
    public Button btnIkinciPencere;
    public Button btnKapat;
    public int X;
    public int Y;
    public void PencereAyarla(String baslik,int genislik,int yukseklik,int konumX, int konumY,Color
    arkaPlanrengi)
    X=konumX;
    Y=konumY;
    p1=new Frame(baslik);
    p1.setLocation(konumX,konumY);
    p1.setBackground(arkaPlanrengi);
    p1.setSize(genislik,yukseklik);
    p1.setLayout(new FlowLayout());
    p1.addWindowListener(this);
    btnIkinciPencere= new Button("Ikinci Pencere");
    btnKapat=new Button("Kapat");
    p1.add(btnIkinciPencere);
    p1.add(btnKapat);
    btnKapat.addActionListener(this);
    btnIkinciPencere.addActionListener(this);
    p1.setVisible(true);
    public static void main(String args[])
    IlkPencere p=new IlkPencere();
    p.PencereAyarla("ANA PENCERE",250,100,0,0,Color.white);
    public void actionPerformed(ActionEvent e)
    if(e.getSource()==btnKapat)
    p1.setVisible(false);
    else if(e.getSource()==btnIkinciPencere)
    IlkPencere p=new IlkPencere();
    X=X+50;
    Y=Y+50;
    p.PencereAyarla("ANA PENCERE",100,100,X,Y,Color.red);
    public void windowClosing(WindowEvent e)
    System.exit(0);
    public void windowOpened(WindowEvent e)
    public void windowClosed(WindowEvent e)
    public void windowIconified(WindowEvent e)
    public void windowDeiconified(WindowEvent e)
    public void windowActivated(WindowEvent e)
    public void windowDeactivated(WindowEvent e)
    I am using java server. I want this ; Any client can run my project(create with studio creator) with explorer after click any button after this class run application windows(but this windows application must run on server)
    I don't want to install any program in client PC. Client PC which have got only explorer, may be use this application.
    Thanks,

    or can i hidden explorer tools and address bar. User must use only my application menu.
    How can i solve it.

  • How can  I access my java class file in a .jar file ...PLz Help anyone!!

    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program.
    Plz help ...I have tried all I know in vain.
    Thanks.

    temba wrote:
    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program. You are making little sense. You can't instantiate .java files.
    Plz help ...I have tried all I know in vain.
    Thanks.Could you post WHAT you have tried and also post what error messages you received?

  • How can I run a servlet with Sun Java System Application Server PE 8?

    I've created a package with a TestServlet.class inside, used the deploytool to create a WAR and deployed this using the autodeploy folder.
    The filestructure has been generated and I find the TestServlet.class in
    [installdir]\domains\domain1\applications\j2ee-modules\testProject\WEB-INF\classes\[packagefolderstructure]\TestServlet.class.
    The context root is working fine, but I have no clue how I can run the servlet directly via the URL.
    I've tried many things like
    http://localhost:8080/testProject/TestServlet
    http://localhost:8080/testProject/servlet/TestServlet
    http://localhost:8080/testProject/servlet/[packagenamewithpoints]TestServlet
    http://localhost:8080/testProject/servlet/[packagenamewithslashes]TestServlet
    etc etc
    Can somebody tell me please how to write URLs to deployed servlets? Or send me an example url and xml descriptor files?
    Thanks a lot in advance!

    in web.xml use servlet mapping
    <servlet-mapping>
        <servlet-name>TestServlet</servlet-name>
        <url-pattern>/doit</url-pattern>
    </servlet-mapping>then use http://localhost:8080/testProject/doit

  • How can i run 2 i tunes accounts on the same computer without songs duplicating?

    my wife and I both have ipods, how do you run an account each on the same computer without files syncing on both ipods/ libraries?

    Using More than One iDevice on the Same Computer
    This applies mainly to couples who are adding another device and do not want their email, messages, etc. being duplicated on both devices. To begin read: How to use multiple iPhone, iPad, or iPod devices with one computer. You need to establish a separate Apple ID and password for whomever will use the new iDevice. See Apple - My Apple ID and Frequently asked questions about Apple ID. The easiest way is to do this on the computer using iTunes: iTunes- How to set up an Apple ID within iTunes.
    On the computer create a new user account for the person with the new iDevice. This will be the user account that person will always use. He/She will no longer use the other user account. This way that person will have a separate iTunes Library
    Start by transferring the new device(s) to a new account along with all your data.  Save any photo stream photos that you want to keep to your camera roll (unless they are already in the camera roll) by opening your Photos app, tap on Albums icon at the bottom. Now, tap on My Photo Stream album; tap Select; tap on the photos you want to select;, tap the share icon (box with upward facing arrow) in the lower left corner; then tap Save to Camera Roll.
    If you are syncing notes with iCloud that you want to keep then you need to open each of your notes and email them to yourself. Later you can copy and paste the text into new notes created in your new account.
    Tap on Settings > iCloud > Delete Account (only deletes it from this device, not from iCloud; the person keeping the current account will not be affected,) provide the password to turn off Find My Phone and choose Keep on My iDevice when prompted.  Sign in with a different Apple ID to create your new account. Choose Merge to upload your data.
    Once you are on separate accounts, you can each go to icloud.com and delete the other person's data from your account.
    Note: The essence of the above was created by user, randers4. I
    have made substantial changes to improve readability and syntax.

  • How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?

    Greetings all,
    I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
    We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
    The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
    For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
    There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
    I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
    PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
    var myPresets = app.pdfExportPresets.everyItem().name;
    myPresets.unshift("- Select Preset -");
    var myWin = new Window('dialog', 'PDF Export Presets');
    myWin.orientation = 'row';
    with(myWin){
        myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
        myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
        myWin.myPDFExport.selection = 0;
        myWin.btnOK = add('button', undefined, 'OK');
    myWin.center();
    var myWindow = myWin.show();
    if(myWindow == true && myWin.myPDFExport.selection.index != 0){
        var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
        myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
        if(myFile != null){
            app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
        }else{
            alert("No File selected");
    }else{
        alert("No PDF Preset selected");
    So far my code does the following:
    1) Runs the Multi-Page PDF Import Script
    2) Runs PDF Export Script Above
    3) Toggles the Template
    4) Runs #2 Again
    5) Deletes the imported PDF and all pages and toggles template again.
    It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
    Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!

    If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
    Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
    It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.

  • Flash Builder 4.6 - How can I keep unit test classes out of the finished swc?

         I have a library of code I'm building and I'm working on unit testing but I have a major issue. When my finished swc compiles no matter what I do it includes the unit test classes as part of the intellisense if you load the swc via flash. The classes aren't really in the swc since if you just try and import them they'll come up undefined. They only appear to go into the intellisense for the swc. Does anyone know how can I keep this from happening in the finished source? Currently my folder setup is like this in flash builder.
    src\main - source documents for the library to get compiled
    src\mock - mock class area for unit testing
    src\test - unit test classes
         In the project Properties panel > the first tab of my Flex Library Build path I have selected only the src\main folder for the classes to inlude in the library. No other folder paths are selected.
    The "Flex Library Build Path" doesn't change my results with any setting.
    Thanks,

    Mel Riffe,
    Here's a Help topic about compiler options in Flash Builder: http://help.adobe.com/en_US/flashbuilder/using/WSe4e4b720da9dedb524b8220812e5611f28f-7fe7. html
    For information on using mxmlc, the application compiler, to compile SWF files from your ActionScript and MXML source files, you can see: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fcc.html
    Hope this helps,
    Mallika Yelandur
    Flash Builder Community Help & Learning
    Adobe Systems Incorporated

  • How can I run multiple midlets in parallel via the raspberry pi cmd line interface?

    I am trying to run multiple midlets at the same time on my raspberry pi.
    From netbeans point of view I am able to deploy and run them. But for my applications I want to auto start multiple midlets on the raspberry pi.
    On the cmd line interface of java me 8 I have commands to install a midlet and run a midlet.
    But i am not able to start multiple midlets.
    Can someone explain to me how I can do this?

    Hi!
    Could you please clarify a bit: do you want auto-start behavior of your applications or be able to start them manually via CLI?
    Because "auto start" means that applications are started by Java once you start Java itself and in order to make it happen you shall mark your applications appropriately (check MEEP spec for "MIDlet-<n>-Type" application attribute value "autostart"). If this is the case, have you added this attribute?
    If you want to run them manually you should be ale to do so via CLI just the same way as you start one application (via "ams-run" command).
    Either way, could you also please clarify what are the symptoms of the problem? E.g. on CLI what are the messages you receive back (if start is unsuccessful what is the error message etc).
    In addition please mind that there is limit on number of simultaneous VM tasks. If I'm not mistaken by default it is 6: 2 of them are used by system code and each running MIDlet consumes 1 VM task. If you want to increase it please change the value of "MAX_ISOLATES" property in jwc_properties.ini file. The maximum supported value is 16
    Regards,
    Andrey

Maybe you are looking for

  • My introduction and a hardware discussion.

    Hello Adobe forums. Its nice to meet you all. This is going to be a heavy first post, hopefully it will bloom into a great discussion. I have been reading and learning and just wracking my brain around all the great info here for building a NLE syste

  • How can I remove photos a subscriber posted to an iCloud photo album?

    So my 16 year old cousin just posted over 600 photos to a shared family photo album.  How or why she did this, I can't imagine.  I've turned off 'subscribers can post' and removed her from the shared album.  If I delete them from the shared album, do

  • How to mention index in select query?

    Hi All,    If I am using fields of two diffrent secondary index in a single select query on a table how I can mention that data should be picked according to first index used in the query? Regards Deepak

  • IWeb Photo Page download

    Are people able to download any photos from iWeb photo pages? During the slideshow feature it says 'download', does that mean visitors to my site can download my content?

  • I can't find Actions in windows panel,i am using Adobe Photostop CS 6 version

    hii...i am using Photoshop CS6 version when i tried to open actions in windows panel i can't find it.can anyone help me ?