Java mysql OK with Terminal but not OK with Apache local web server

With terminal I have :
CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/:/Library/Java/Extensions/:./
SUDO_GID=20
SECURITYSESSIONID=210800
_=/usr/bin/printenv
127:/Library/WebServer/Documents/Java root# java TestMySQL
2006-05-21 13:39:00.0 ************************************************** = OK
127:/Library/WebServer/Documents/Java root#
import java.sql.*;
* mysql-connector-java-3.1.12-bin.jar
*   % javac /Library/WebServer/Documents/Java/TestMySQL.java
*   % java TestMySQL
public class TestMySQL {
        public static void main(String argv[]) throws Exception {
                // Load the driver class
                Class.forName("org.gjt.mm.mysql.Driver");
1                //Class theClass = null;
2               //try {
3                //    theClass = Thread.currentThread().getContextClassLoader().loadClass("org.gjt.mm.mysql.Driver");
4                //}
5                //catch (ClassNotFoundException e) {
6                //    theClass = getClass().getClassLoader().loadClass("org.gjt.mm.mysql.Driver");
7                //}
                Connection conn = DriverManager.getConnection(
                        "jdbc:mysql:///test",
                Statement stmt = conn.createStatement();
                ResultSet rset = stmt.executeQuery("SELECT now();");
                while (rset.next()) {
                        System.out.println(rset.getString(1));
                // Close result set, statement and DB connection
                rset.close();
                stmt.close();
                conn.close();
}I have a simple TestMySQL.html file with applet TestMySQL.class in it.
Nothing but "Applet TestMySQL not inited"
When I uncomment the try/catch lines (lines 1 to 7) , java compiler generate an error... near getClass().getClassLoader().loadClass("org.gjt.mm.mysql.Driver");
With "Class.forName("org.gjt.mm.mysql.Driver");" no problem.
Running MacOS X 10.3.9, Apache/1.3.33 (Darwin) PHP/4.4.1 mod_ssl/2.8.24 OpenSSL/0.9.7i and JVM 1.4.2_09
Thanks for help.
P.S. This my first approach to java/mysql but I would like to see this short program running on my local web server ...
Thanks.

hi :-)
can you post the stack trace?
im not sure what is causing the error because of less info,
but have you tried to copy the driver of mysql to tomcat lib folder?
regards,

Similar Messages

  • Any way to re-get apps purchased with iphone but NOT synched with computer?

    My iPhone had been having issues synching so one of the Tech guys decided that the best way to solve it was by upgrading to OS4 and seeing if that fixed the problem. Unfortunately they didn't do a full backup (apparently it kept aborting part way thru) and I had apps that hadn't been synched to my iTunes account on the computer. Does anyone know of any way for me to get those apps back without buying them again? I was thinking that their might be a record of their purchase in my iTunes account since I had to have accessed it, even though it was thru the phone, to buy them in the first place, but I don't see it. I also don't know if I can just contact someone in tech support at apple about fixing it because I didn't see a logical way to contact them about the issue.

    Well, you missed several chances, so now all that's left is to redownload them individually. At least you can do that without paying for them again. You can't do that with music.
    You apparently didn't back up your iTunes library, in spite of regular reminders from iTunes when you make purchases. AND you don't have an external drive with Time Machine, which would have backed up your computer (including iTunes) automatically.
    Before syncing you could have copied your apps from your iPhone to iTunes, as described in the manual, but apparently you didn't.
    It's also not clear how iTunes "lost" your apps, unless you had a hard drive failure. This just doesn't happen, unless you have done something to your iTunes folders or had a hardware failure. I would suggest tracking down how iTunes lost your apps before you go any further; you may have a much bigger problem with your computer.

  • Generating idocs with MASTER_IDOC_DISTRIBUTE, but not finding with WE02

    Hi All,
    I am generating one IDOC for the message type LOIPLO, Idoc type LOIPLO01 with using the function module MASTER_IDOC_DISTRIBUTE.  Function module is returning the idoc number, but if I go and see in WE02, it is saying "No idocs are selected". 
    For the partner package size is 1000.  Is it the reason ?
    Thanks,
    sreenivas.

    Hi,
    Don't give any search criteria execpt for ur message type LOIPLO in WE02  and check..If the idoc is created definitely it will be shown..
    Regards,
    Nagaraj

  • I can video chat with John, John with Mike, but not Mike with me?

    My brother lives in Abu Dhabi and he and I can video chat. He can also video chat with my dad (Mike) who lives about 500 yards from me (in North London). But I can't video chat with my dad, nor can we audio chat!
    We've both attempted to initiate the chat and get the error code "-8", upon clicking 'accept' the other party gets a message that the invite has been refused.
    Can anyone offer any suggestions as to how I can go about getting this resolved? I'd like to get to the stage when all three of us can video chat at once.
    Thanks for any advice.

    Hi
    First have you all set the Quicktime streaming setting, goto sys prefs/quicktime/streaming/streaming speed, set to 1.5mbps
    In ichats prefs click on video and change bandwidth limit to none.
    Restart iChat.
    And also try logging on to AIM on port 443 rather than port 5190.
    Go to IChat in the menu bar > Preferences > Accounts.
    Log out of AIM and then use the Server Settings tab
    Set the port to 443.
    Log back in again.
    Tony

  • Js working with FF but not working with IE

    Dear All,
    I have created a text field P5_NO1 and in the
    Post Element Text
    <span style="color:#0000ff;font: normal 1.2em "Lucida Sans Unicode",sans- serif;font-size:12px;"> <select id="unit" onchange="TankUnit();" >
    <option> -S-</option>
    <option> ml</option>
    <option> kg </option>
    </select> Units
    </span>
    the js TankUnit() works fine in FF not in IE
    I have an sample in apex.oracle.com
    http://apex.oracle.com/pls/otn/f?p=4000:4150:4089089633206316::NO:::
    can anyone help me to solve the problem?
    bye
    Srikavi

    Hi Peter and John,
    FF is so... tolerant to accept the value of the option as the same as it is displayed in the select list.
    where IE is so... prudence, that we have to explictly tell it
    ie Post Element Text in IE should be like this
    <select id="unit" onchange="TankUnit();" >
    <option> -S-</option>
    <option value="ml"> ml</option>
    <option value="kg"> kg </option>
    </select> Units
    bye
    Srikavi

  • Tiger Server: Default MySQL works for phpMyAdmin but not command line ? ? ?

    Greetings all,
    I followed the excellent instructions at
    http://discussions.apple.com/thread.jspa?threadID=132783&tstart=0
    on upgrading PHP to version 5 and getting (the preinstalled) MySQL setup with phpMyAdmin
    I can connect through the phpMyAdmin, create new dbs, etc. Problem is that now I CAN'T connect from the command line. (I originally set my new root password from the command line and that's the last time I could connect from there!
    Now I get the dreaded ERROR 2002 when I attempt:
    /usr/bin/mysql -h localhost -u root -p
    If I use the IP address or hostname instead of "localhost" (after -h) I get a ERROR 2003. Dropping the -h and hostname from the line above still gets me a ERROR 2002.
    My phpMyAdmin config is a connect type "TCP" not socket, which might be one reason it works and the command line doesn't, but I still don't know where I've gone wrong.
    My /var/mysql/* is all owned by mysql and group www.
    I'm finding lots of people asking about the ERROR 2002, but not finding any solutions (particularly for Tiger Server). I'd prefer to use the preinstalled MySQL to installing a new installation (the thread referenced above says upgrading or removing the MySQL installation is too hard to do) and there has GOT to be a reasonable explanation for why it works with phpMyAdmin, but not the command line.
    Thanks in advance for any replies!
    Many   Mac OS X (10.4.3)  

    You know what? I think when I started mysql_safe, I did it with sudo. Maybe that is my problem?
    If so, what user do I want to start it as? I've seen one suggestion of doing this:
    ./bin/mysqld_safe --user=mysql &

  • Java update and real player update not compatable with firefox 6 on Windows 7. Will they still function right?

    When i opened firefox today , there were updates but when it tried to update it came back that java and real player updates were not compatable with my firefox. I have Firefox 6. Will these 2 programs still work all right if they are not updated?
    I'm sorry I don't know what installed plugins I have. After putting in search it says I have Java 6 Standard Edition Update 26. I have Real Player(tm)(win32), Version 14.0.4 652. Hope that is enough information

    I just had a similar issue and I ended having to manually clean up the registry to get Java working again.
    I just got a new computer at work and it had Java 7 installed but it turns out an app we need to use at work doesn't work with Java 7, only Java 6.
    I uninstalled Java 7 and installed Java 6 but Firefox was not showing the Java plugin as installed. I tried all sorts of things, including uninstalling and reinstalling Firefox and none of it worked. Finally I again uninstalled Java and then I searched for "Java" in the registry and found TONS of entries still in there for Java, including for Java 7. I manually deleted all the entries (WARNING: this is extremely risky) rebooted, then installed Java 6 and now it's working fine.
    I really hate it when uninstallers leave stuff behind. It just makes a mess.

  • Bluetooth paired with Photosmart but NOT connected.

    Bluetooth connection on android device says paired with Photosmart but NOT connected. How do I get connected?

    You can always manage or configure the switch via HyperTerminal. You can connect the PC to a serial cable and access the switch via the serial port. Hyper Terminal doesn’t depend on the IP address of the switch so you can manage it. To access the switch via Hyper Terminal, follow this link: 
    http://linksys.custhelp.com/cgi-bin/linksys.cfg/php/enduser/std_adp.php?p_faqid=16613&p_created=1212...

  • HP D110 AIO printer. Prints jam when printing with wireless, but not when hooked to USB cable! HELP!

    I have a HP D110. It jams the paper when I print with wireless, but not when I use USB cable. Any ideas?

    From what you describe you are having issues printing from MS Office. Have you had trouble printing from other resources on your computer (e.g. from the internet or another program)? The first thing I am going to suggest is that we start by uninstalling and reinstalling the printer from the resources available online. 
    First if you use a USB cord, make sure to remove it (this is important). Do not plug it back in until the software directs you to. Then go through the Devices and Printers, Programs and Features and Device Manager folders and insure that all copies, files, and programs related to the printer are removed. Then as directed, restart the computer. 
    In the START menu type "%temp%" and press ENTER. Here I want you to press Ctrl+A and hit DELETE. Some of the files will not allow you to delete them, skip those files and delete the majority that allows it. 
    http://h20000.www2.hp.com/bizsupport/TechSupport/DriverDownload.jsp?prodNameId=3562006&lang=en&cc=us...
    Install that and let me know the result! 
    Have a great day!

  • Move graphics with text--but not inline--in PM...??

    Hello, is there a way in PageMaker to move graphics with text but not inline? I ask because right now I see two options for graphics:
    --inline, so you cannot place the graphic exactly where you want AND the text only flows way above or below--but not next to--the graphic
    or
    --independent so you can place the graphic exactly where you want and the text DOES flow right next to the graphic, but then the graphic doesn't move with the text
    I'd like to be able to place graphics exactly where I want AND have them move with the text, like the "Move object with text" option in Word.
    thank you!
    L

    well it has been a while since i used PageMaker so i didn't realize it was "dead."
    though i'm not surprised and am kind of glad. i was hired into a new job recently
    to work on a department newsletter, and i'm trying to find a good authoring program
    within our budget. right now the newsletter is in Word but we've had a lot of problems
    with Word so i'm seeking an alternate solution. i'd like Frame but again there isn't
    enough money in the budget. i need a good option that is $500 or less...i'm trying Publisher
    now too but not enough functionality...

  • TS1398 hi my ipad is connected to my wifi but it keeps coming up with safari could not open the page because the server stopped responding its saying this know matter what i try to open what am i doing worng please help

    my ipad will not load any pages an after about 10 mins comes up with safari could not open the page because the server stopped responding but iam conected to wifi please help as i have been trying for 2 days now and is doing my head in

    Does the iPod connect to other networks OK?
    Do other devices now connect and work OK?
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on the router
    - Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • IO assigned with Asset,but not coming at the time of PO creation

    Hello
    IO assigned with Asset,but not coming at the time of PO creation.
    I have made following settings:
    1     Depreciation - IFRS (INR)              1     0L
    15     Income Tax Act                             0
    20     Depreciation - Indian GAAP (INR)     3     1L
    30     Depreciation - IFRS (USD)              0
    31     Depreciation - Indian GAAP (USD)       0
    In ACSET-Account assignment:
    for dep area-20
    CAUFN     Internal Order     *     Generic Trans. Type     02 Depreciation Run
    KOSTL     Cost Center     *     Generic Trans. Type     02 Depreciation Run
    so currently i am using only dep area-20 only(Indian GAAP)
    CAPEX budgeting is through IO. AUC is not doing through IO,its directly from AIAB/AIBU
    AS01
    KO01
    AS02
    KO22
    KO30
    so what is the problem,why i am not getting IO (which is in display mode in PO) when assigned the Asset with category of "A" (asset) in PO.......when i assigned Asset- the GL account come automatically but IO didn't come.
    kind regards

    Hey Ajay
    thanks for your reply.....
    now i'm getting new error:
    Parallel depreciation area 31 is not posted
         Message no. AA565
    Diagnosis
         The asset to be posted does not manage parallel depreciation area 31, or
         transaction type  that you are using is limited to certain depreciation
         areas, and does not contain depreciation area 31. This is incorrect.
    System Response
         Posting is rejected.
    Procedure
         Check the asset and the transaction type.
    I have checked some configuration but not able to debug it.
    regards

  • TA25361 I have a ton of documents and databases in AppleWorks v 6.0 that I can no longer open on my MacBook Pro.  Is there any way to recover this info?  Some documents can be opened and resaved with textedit, but not my database with all important addres

    I have a ton of documents and databases in AppleWorks v 6.0 that I can no longer open on my MacBook Pro.  Is there any way to recover this info?  Some documents can be opened and resaved with textedit, but not my database with all important addresses.

    I tried Peggy's List > Select All > Copy > Paste into an AW spreadsheet suggestion.
    In my case, pasting into the spreadsheet lost all text formatting (mostly text set to bold). The results of formulas were pasted, and checkboxes were pasted as "on" or "off". The DB did not contain any pop-up menus or radio buttons, but I expect they would transfer as a number showing the list position of the chosen item.
    Pasting the copied List view data into a Numbers table gave a result similar to that with AppleWorks. I selected B2 as the target cell (for top left cell of the pasted data) to avoid any effects of posting into a header row or column. Bold and regular text formatting looked the same as it had in AW's List view.
    Based on that, I'd slip the 'paste into an AppleWorks Spreadsheet step, and paste directly into a Numbers Table.
    Regards,
    Barry

  • Hp Officejet Pro 8500 will print but not anything with black ink. It keeps aligning itself.

    My Hp Officejet Pro 8500 will print but not anything with black ink - i have checked the black ink cartridge and it is full. Whenever i print anything in colour (only option) the printer goes into an alignment/maintenace loop that lasts for a long time and does not fix the problem. What should I do?

    Clean your printerhesd 4-5 times until the black fully restores.  I am on my third complete cleaning and have gone from 0% black to approx. 60-70%.  So, it works just takes time.

  • Why does the FP 10 work with firefox but not with IE8

    I down loaded the folowing for xp FP uninstall, FP plugin and FP debug from the link in one of your replys. now I can watch youtube  with firefox but not with IE8. you asked me before if i was using 16 bit. whats that mean and how do I find out? please help I just want to watch youtube on IE!

    Ok Shag, since you hadn't been on a Forum before, then I'll take some of what I said back:-) I wanted you to stay on one thread, you can get in trouble trying things that may cause you more problems than you had in the beginning. I just had your best interest at heart
    I'll even overlook your all caps here:-) At least you responded
    Now since you say you fixed it, what you should do is to confirm it is fixed by taking a look at your Flash folder. This contains all of the Flash files for IE and FF. Then make sure you have the IE add on and the FF add on. That way if you have any future problems, at least you would know it is not the Flash Player.
    You should only have 2 .exe files for IE and 1 for FF.
    For Video editing, I would check Microsoft and see what they have. Perhaps someone else will come along with other info for you.
    No, I don't get paid here, since I am not an employee. Just a user helping others, since I had a problem at one time and after 4 hours of researching solved it.
    Let me know if you want to check the Flash files.
    Thanks,
    eidnolb

Maybe you are looking for

  • Index:0 Size:0 error for non administrator group

    Hello, I have some dasboards and webis that I want to run in the iPad, If I login as Administrator everything is fine, but if I login as any other user I get the error: Index:0 Size: 0 can anyone tell me what I am missing?  I already check the note 1

  • Php configuration issue with libmysqlclient

    Hi , I am getting  below issue while configuring php 5.3.3 with below command ./configure --with-apxs2=/local/apps/rxapi/apache/bin/apxs --with-openssl --with-mysql=/opt/mysql/mysql --enable-dbase --with-libdir=lib/64 --prefix=/local/apps/rxapi/php5.

  • HT4437 Apple TV - sound only

    When using Apple TV with some apps (eg Sky Go), the Apple TV icon shows only a loudspeaker and only sound, no video, is available through the apple tv. in stead the video continues to show on the iPad. I don't understand why this should be the case o

  • Sync Mediator calling Async BPEL

    Hi, I have an Synchronous mediator which will invoke an Async BPEL. Aync BPEL will do some processing and need to send the response back to the mediator which is not happening. Any ideas on how to get the response from the Async BPEL pass on to the S

  • Indicator on 3D dial guage

    HI , I am using 3D Dial gauge. My requirement is to set the arcs as 0 to 85 : Red, 85 to 95 :Yellow, 95 to 100: Green with the Min range and Max range as 0-100,and I also need to change the indicator color and  postion /direction based on needle post