Cant install mysql driver

hi
i'm very new to java (just curious)
i'm following this tutorial on databases and at certain point i've to use the driver
i went to mysql download this:
mysql-connector-java-3.0.9-stable wherein is the .jar file.
i googled a lot in forums and also read the readme and the sun One Studio 4 update 1 (the version i'm using). Cant find a hint on how to solve it, because when i try to compile i get this error:
"TesteJDBC.java [25:1] unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
Class.forName("com.mysql.jdbc.Driver").newInstance();
^
TesteJDBC.java [25:1] unreported exception java.lang.InstantiationException; must be caught or declared to be thrown
Class.forName("com.mysql.jdbc.Driver").newInstance();
^
2 errors
Errors compiling TesteJDBC."
here's the relevant code:
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
i'm using winxp pro, jsdk1.4.1_02 and all the windows updates...
I tried to mount filesystem and also tried the tutorial on java where i define the classpath, in dos... but that didnt work too.
Can someone help me please?
remember i'm very new to this...
thanks in advance

thanks for your answer
i'm not sure about what you exactly mean.
this code is from a book i'm reading. What should i do in order just to test a code that connects and inserts into a database?
my code:
import java.sql.*;
import java.util.*;
public class TesteJDBC {
public static void main(String[] args) {
Connection conn = null;
try {
     // mysql-connector-j-2.0.14-bin.jar tem que estar na CLASSPATH
//String url = "jdbc:mysql://localhost/pedro"; // jdbc:mysql://localhost/Pedro?user=xxxx&password=yyyy caso
// usassemos controlo de acessos
String url = "jdbc:mysql://localhost/Pedro?user=root&password=***";
String xt;
Statement st;
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(url);
st = conn.createStatement();
xt = "INSERT INTO Teste (id, valor) " + "VALUES(" + args[0] + ", " + args[1] + ")";
System.out.println("String exec:" + xt);
st.executeUpdate(xt);
catch (SQLException e ) {
e.printStackTrace();
catch (ClassNotFoundException e) {
System.out.println("Classe nao encontrada");
catch (InstantiationException e) {
System.out.println("Classe nao instanciada");
catch (IllegalAccessException e) {
System.out.println("Acesso Ilegal");
finally {
if(conn != null ) {
try { conn.close(); }
catch( Exception e ) {}
thank you again

Similar Messages

  • Cant install any driver for Hp NVidia gt230 on Touchsmart 600-1055

    Last few years I bought a HP Touchsmart oversea when I travelled to US then I brought it back to Australia. First couple months it was fine then one day I turned on the PC then It is just black screen after the window 7 boot screen then restart after few seconds. It keeps repeating that process unless I go to Safe mode and remove its NVidia driver and replace with window standard driver ( Video Controller VGA compatible) then I can boot up the window normally but cant use any program that require the delicated graphic card. I have tried hard to find its driver from every resources that I can find on the internet including Hp website and NVidia webiste but still again no luck. for 3 years I still cant find the driver for this that can make it working. What happened? is it my graphic card physically fault or because the software isusse? I forgot to mention that I even try to use the DVDs that I orders from HP USA and try to factory recovery but it is still having the same issue. I try to install many different version of window in cluding win 7 32&64 bits, Window 8 pro 64 bits then STILL NO LUCK. So could anyone please tell me what happened and how to fix it cause as I am aware that HP australia not support for HP USA product and I dont want to see my expensive desktop become a brick. 
    Thanks

    Hello Trung_Hau_Le,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I understand that you are having issues where you cannot use the higher end graphics card installed in your HP TouchSmart 600-1055 Desktop PC. The issue you are describing appears to be a physical issue and I think it would be best if you contacted HP technical support for repair options.
    US support link to contact options for HP products purchased in the US.
    Outside of US support link to contact options for HP products purchased outside the US.
    Now just because you purchased the computer in Australia does not mean your warranty is not good in the US. I am providing you with a link to theHP Global Warranty and FAQs, which states the following:
    HP Global Warranty covers HP products at the level of standard warranty offered in the country in which it is used. For example, a product purchased in country "A" and moved to country "B" receives the current warranty coverage provided by country "B" (if that product is marketed or supported in country B)
    This means that your computer  receives the same treatment in the US as a computer sold in the US. I would recommend you contact HP Technical Support to have your issue addressed.
    I would like to thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

  • Cant install device driver software, install device driver software

    have recently updated my ipad to iOs 5 and now all i have is the 'connect to iTunes' page even when i have connected
    it. my windows computer then tries to install device driver software but it canno be located .... really stuck and help would
    be great ..

    Sounds like your i tunes set up on the windows machine is messed up.  Suggest you reinstall itunes again.   Drivers etc should be in the package.   A fair number of windows folks have firewall related time out issues, so turn the firewall off along with your antivirus when you do the i tunes download.

  • Cant Install Software Driver for HP PSC 1310

    My software was not working correctly, so I deleted it in add & remove programs.
    I cant install the new downloaded software.
    After downloading the software, it extracts, but then nothing happens.
    I do not get the information box as shown in the videos on this page
    http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?product=374568&lc=en&cc=us&dlc=en&lang=en&cc=us
    The only software showing in add & remove programs is HP Support Solutions Framework.
    This is the software that I have downloaded to my desktop gc_w01_ENU_NB
    Thanks,
    Dave

    I still dont find the file...
    Does this help?
    20140915200435:4158185B8A:0001(Setup.exe)Parsed command line: "C:\DOCUME~1\DAVEB~1\LOCALS~1\Temp\7zS3451\Setup.exe"
    20140915200435:415818C773:0001(Setup.exe)Using datfile: C:\DOCUME~1\DAVEB~1\LOCALS~1\Temp\7zS3451\autorun.inf
    20140915200435:415818DC8B:0008(Setup.exe)## GetValueByLang(    f->c_str(), _T(Version), _T(LanguagesInthisCD) failed
    20140915200435:415818F0B5:0008(Setup.exe)## Found ENU already installed on this machine!  It is not on our CD though, so we are continuing
    20140915200435:41581903EA:0008(Setup.exe)## GetValueByLang(    f->c_str(), _T(Version), _T(LanguagesInthisCD) failed
    20140915200435:4158191ECE:0001(Setup.exe)System LangID = 1033.  mapped to ENU
    20140915200435:4158193E79:0008(Setup.exe)## The system language is ENU, but it isn't on our CD!
    20140915200435:41581BFC98:0008(Setup.exe)## We couldn't figure out a language to use, and are returning FALSE from CICECmdLine::GetLanguage()!
    20140915200435:41581C27E8:0008(Setup.exe)## GetValueByLang(    f->c_str(), _T(Version), _T(LanguagesInthisCD) failed
    20140915200435:41581C5C36:0001(Setup.exe)Parsed command line: "C:\DOCUME~1\DAVEB~1\LOCALS~1\Temp\7zS3451\Setup.exe"
    20140915200435:41581C85DC:0008(Setup.exe)## GetValueByLang(    f->c_str(), _T(Version), _T(LanguagesInthisCD) failed
    20140915200435:41581CB1EC:0008(Setup.exe)## GetValueByLang(    f->c_str(), _T(Version), _T(LanguagesInthisCD) failed
    20140915200435:41581CEE9C:0008(Setup.exe)## Either manufacturer or _productSeries is empty.
    20140915200435:41581D1F96:0001(Setup.exe)Parsed command line: "C:\DOCUME~1\DAVEB~1\LOCALS~1\Temp\7zS3451\Setup.exe"
    20140915200435:41581D4900:0008(Setup.exe)## GetValueByLang(    f->c_str(), _T(Version), _T(LanguagesInthisCD) failed
    20140915200435:41581D78DC:0008(Setup.exe)## GetValueByLang(    f->c_str(), _T(Version), _T(LanguagesInthisCD) failed
    20140915200435:41581DAA8D:0001(Setup.exe)Setup returning 1603

  • Cant install mysql

    Hello. When I try to install MySQL I get this:
    chown: invalid user: `mysql'
    chown: invalid user: `mysql'
    chown: invalid user: `mysql'
    Installing MySQL system tables...
    101026 20:31:59 [ERROR] Fatal error: Can't change to run as user 'mysql' ;  Please check that the user exists!
    101026 20:31:59 [ERROR] Aborting
    101026 20:31:59 [Note] /usr/sbin/mysqld: Shutdown complete
    Installation of system tables failed!  Examine the logs in
    /var/lib/mysql for more information.
    You can try to start the mysqld daemon with:
        shell> /usr/sbin/mysqld --skip-grant &
    and use the command line tool /usr/bin/mysql
    to connect to the mysql database and look at the grant tables:
        shell> /usr/bin/mysql -u root mysql
        mysql> show tables
    Try 'mysqld --help' if you have problems with paths.  Using --log
    gives you a log in /var/lib/mysql that may be helpful.
    Please consult the MySQL manual section
    'Problems running mysql_install_db', and the manual section that
    describes problems on your OS.  Another information source are the
    MySQL email archives available at http://lists.mysql.com/.
    Please check all of the above before mailing us!  And remember, if
    you do mail us, you MUST use the /usr/bin/mysqlbug script!
    error: command failed to execute correctly
    Optional dependencies for mysql
        perl-dbi
        perl-dbd-mysql
    When I try     
    shell> /usr/sbin/mysqld --skip-grant &
    shell> /usr/bin/mysql -u root mysql
    I get this:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    [1]+  Done                    /usr/sbin/mysqld --skip-grant
    What is this? I have never had any problems with installing MySQL before. I need it for a MythTV install. BTW, this is a fresh install made today of Arch Linux.
    Last edited by jai134 (2010-10-26 18:57:51)

    First pacman -Syy then pacman -Suu and finally pacman -S mysql. I have also tried pacman -Rcsn mysql, pacman -Scc and after that a locate mysql to find all dirs holding any files  connected to mysql so I could delete those. Then again pacman -S mysql and now I don't get any error messages during install but I am unable to start the server with /etc/rc.d/mysqld start.

  • Cant install Device driver

    Windows shows my ipod. but not itunes. it started showing it once but quit.now it says it cant intall device driver software in the device manager. it wont restore or anything. the screen just says do not disconnect. i even left it over nite..do i need to reinstall the software in my ipod or what..and my computer has all the necessary updates..HELP!!

    Sounds like your i tunes set up on the windows machine is messed up.  Suggest you reinstall itunes again.   Drivers etc should be in the package.   A fair number of windows folks have firewall related time out issues, so turn the firewall off along with your antivirus when you do the i tunes download.

  • How to install MySQL driver for ODI Studio?

    Hi,
    I follow the docs to install driver. http://download.oracle.com/docs/cd/E14571_01/core.1111/e16453/install.htm#CHDBIFAJ
    First I downloaded MySQL Java connector from http://dev.mysql.com/downloads/connector/j/. Then copy the jar file to C:\Users\MyName\AppData\Roaming\odi\oracledi\userlib. But ODI Studio cannot show this JDBC driver, when I created a new Data Server.
    Is there any additional step need to do?

    Hi Sukande,
    Deployment procedure is same irrespective of operating system.
    On AIX, you have to copy the file com.sap.aii.adapter.lib.sda to your desktop and modify using winrar as explained in the below article and copy the modified file back to the respective path on AIX server.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00b4a020-4ae6-2c10-5a95-fed4ad9a4b60?QuickLink=index&overridelayout=true
    Thanks,
    Siva Kumar

  • Installing mysql driver

    hi
    i'm very new to java; i tried to follow a tutorial i've in a book i went to mysql and downloaded mysql-connector-java-3.1.0-alpha.zip. Now i cant indstall it/register.
    in my code i get the following error:
    TesteJDBC.java [25:1] unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    ^
    TesteJDBC.java [25:1] unreported exception java.lang.InstantiationException; must be caught or declared to be thrown
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    ^
    2 errors
    Errors compiling TesteJDBC.
    the piece of code:
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    i'm using the sun ONE Studio 4 update 1
    i read the help and followed the instrutions to classpath but it seems doesnt work...
    thanks in advance

    put the Class.forName("com.mysql.jdbc.Driver").newInstance(); in a try/catch block.
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    //more code...
    catch (Exception e) {
    //code

  • Why i cant install atheros driver?

    i have tecra a8 ez8412
    i downloaded the driver from http://support.toshiba.com/support/driversResults?​freeText=144744
    i downloaded Atheros Wireless LAN Driver for Windows Vista / 7 (32bit/64bit)
    and Atheros Wireless LAN Driver for Windows 7 (32/64)
    but i "Can`t" install both of them
    now in my device manager, i have installed intel(R0 pro/1000 PL network connection and intel (R)PRO/wireless 3945ABG network connection
    please hellpppp

    Tecra A8-EZ8412  part # PTA83U-03J02C
    Your support page is here - http://support.toshiba.com/support/modelHome?freeT​ext=1447444
    Your spec sheet is here - http://support.toshiba.com/support/staticContentDe​tail?contentId=1694205&isFromTOCLink=false
    There are several wireless drivers listed for your model - Atheros wireless lan, Atheros Mini PCI/PCIe Wireless Lan,  intel wireless lan, Intel 802.11a/b/g/n, a/b/g, b/g PCIe Mini Card driver, Intel PROSet Utility.
    That model could have any of those parts, and will use the drivers provided for each one. You said you have intel proset on your device manager and you sound like they where not there before, possibly windows or Microsoft update installed them for you. Does your wireless work now ?
    S70-ABT2N22 Windows 7 Pro & 8.1Pro, C55-A5180 Windows 8.1****Click on White “Kudos” STAR to say thanks!****

  • Lumia 520 cant install HERE DRIVE...

    When i click HERE DRIVE it link to store and the Apps show ! This app is not available for your device. Tab for more info.

    As previously answered on this forum hundreds of times in the last few days, an update for Here Drive + was released a recently. Unfortunately there was a problem with the update and it has been temporarily pulled pending a fix. 

  • Computer crashing if tried to install any driver

    I had to change the HDD of my HP envy 6 as it showed short DST failed report on memory diagnostic. I did not have recovery disc. I installed windows 7 from my windows 7 disc. However when I try to install driver, PC crashes on startup showing blue screen error. It keeps on crashing into infinite loop. It functions normally without any driver. But I cant install any driver.Please help.

    Hi there , I understand that you are having trouble after replacing the HDD on your notebook, and that you are now getting a BLue screen loop when you try to install drivers. I am happy to help with this. I would suggest you start by running all the system diagnostics to see if there is anything else showing a failure of any kind.

  • TS3173 i created a windows partition that was too small and cant install windows... how can I boot on my mac drive to correct this... my computer is defaulting to the windows partion... tried f1 f7 f12... Help

    i created a windows partition that was too small and cant install windows... how can I boot on my mac drive to correct this... my computer is defaulting to the windows partion... tried f1 f7 f12... Help

    Boot Using OPTION key:
      1. Restart the computer.
      2. Immediately after the chime press and hold down the "OPTION" key.
      3. Release the key when the boot manager appears.
      4. Select your OS X disk.
      5. Click on the arrow button below the icon.

  • Cant install mountain lion on a new hard drive 2011 mac pro 17"

    for some reason I bought the infamous 2011 mac pro, and the hard drive kept having IN/OUT problems and after it destroyed half day of work, I decided to get a new hard drive, *blue WD 500g" but i have tried EVERYTHING and i just cant install mountain lion on it.
    1.- i tried forcing the recovery mode so It would connect to the internet and download mountain lion but after 10 min or so i trows the -2002f error at me
    2.- I tried to use the old hard drive that i put on a external hard drive reader so I could get the recovery partition but i just keep restarting the installation no reason given
    3.- downloaded the mountain lion and tried to installing it on the system hard drive of the laptop trough a computer running snow leopard but dosn't let me.
    4.- tried the same thing on target mode without success
    5.- using the recovery partition I used disk utility to se of the partition was locked but it was not
    6.- created a different partition to see if it would install it  there didn't work.
    i just don't understand why
    any toughs?
    if you answer this you would be a personal hero of mine
    cheers

    Make Your Own Mavericks, Mountain/Lion Installer
    After downloading the installer you must first save the Install Mac OS X application. After the installer downloads DO NOT click on the Install button. Go to your Applications folder and make a copy of the installer. Move the copy into your Downloads folder. Now you can click on the Install button. You must do this because the installer deletes itself automatically when it finishes installing.
       2. Get a USB flash drive that is at least 8 GBs. Prep this flash drive as follows:
    Open Disk Utility in your Utilities folder.
    After DU loads select your flash drive (this is the entry with the mfgr.'s ID and size) from the leftside list. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID then click on the OK button. Click on the Partition button and wait until the process has completed.
    Select the volume you just created (this is the sub-entry under the drive entry) from the left side list.
    Click on the Erase tab in the DU main window.
    Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    Click on the Erase button. The format process can take up to an hour depending upon the flash drive size.
    Use DiskMaker X to put your installer clone onto the USB flash drive.
    Make your own Mavericks flash drive installer using the Mavericks tool:
    You can also create a Mavericks flash drive installer via the Terminal. Mavericks has its own built-in installer maker you use via the Terminal:
    You will need a freshly partitioned and formatted USB flash drive with at least 8GBs. Leave the name of the flash drive at the system default, "Untitled." Do not change this name. Open the Terminal in the Utilities folder. Copy this entire command line after the prompt in the Terminal's window:
         sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume
         /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
    Press RETURN. Enter your admin password when prompted. It will not be echoed to the screen so be careful to enter it correctly. Press RETURN, again.
    Wait for the process to complete which will take quite some time.

  • Cant install elements 9 on macbook pro retina. no optical drive

    I bought a new macbook pro retina. it doesnt have an optical drive. i purchased the adobe photoshop elements 9 but cant install it now. can i download it from the adobe website and how do i do that. thanks

    You can download the trial version of the software using the link below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site.
    http://prodesigntools.com/photoshop-elements-9-premiere-elements-9-direct-download-links.h tml

  • How to install Mysql pdo driver

    We are working on a g5 server, Tried to recompiled PHP 5.2.5 but didn't work, then reinstalled PHP 5.2.4 entropy witch is suppose to have Mysql pdo driver but still doesn't work.
    Please help me I'll do your dishes and wash your car!!!!

    I (still) have the same problem.
    I think that it's coming from the compilated php you used, I mean that your is compilated into 32bits whereas leopard is in 64bits.
    So you have to compile php in 64bits.
    I'm trying to compile the php integrated to leopard, but can't find any sources (like .configure) to do this.
    So I've download new php sources and then, I try a compilation, but I can't find the directory where mysql is installed.
    So I've download a new versions of mysql. But like a noob I install mysql 6 which is an alpha version, then I can't install older vesion of mysql.
    I 'll try a hand install of mysql.
    Try to make a new install of php, mysql and compile them into 64bits.
    You will find easily a 64bit version on mysql website.
    Or you can wait for the entropy package which will support leopard.
    Or if you have a better idea.

Maybe you are looking for

  • Sharing my experience, water spill accident on my Retina Macbook Pro

    I would like to share my experience to the community and to fellow mac users regarding my water spill accident on my 1-week fresh Retina Macbook Pro. Before begining, i appologize for gramar or spelling mistakes since I am French and English is not m

  • How can i export 3D plots to a jpeg or bmp or png etc?

    i want to export 3D plots to a picture format how do i do this?

  • VIdeo files: can't export, can't drag, look good but really jpgs

    Hi folks, I've seen various versions of this issue before, but I'm stumped at this point. I have lots of video clips in my Iphoto library (9 - on my MacBook Pro 10.6.6) taken about a month and a half ago. Lots of them were already converted into IMov

  • Aging for Receivables

    Hi Every body, I am logging for first time in SAP FAN CLUB.I hope my beginning will be successful with your help. Our company has configured SAP for new business line. Our requirement is that we want Customer Receivable(Outstanding) ageing for Billin

  • 04X Bonds Issuace - Tax Rate on Coupon not fix every payment

    Hi, I've a problem with product type 04x-Issued Bonds. Corresponding tax rate or amount for the scheduled coupon payment is not fix, therefore, a facility to maintain or adjust the tax amount every payment should be available. How do I do this in sec