Cannot locate DB driver?????

I have put the database driver folder org inside of the folder containing the JSP file
package com.wrox.databases;
import java.sql.*;
import java.util.*;
* Books.java
* Created on 09 February 2003, 13:39
* @author Harvey
public class Books {
String error;
Connection con;
/** Creates a new instance of Books */
public Books() {
public void connect() throws ClassNotFoundException, SQLException, Exception {
     try {
          Class.forName("org.gjt.mm.mysql.Driver").newInstance();
System.out.println("JDBC driver loaded");
con = DriverManager.getConnection("jdbc:mysql://localhost/bookshop?user=");
} catch (ClassNotFoundException cnfe) {
error = "ClassNotFound: Could not locate DB driver.";
throw new ClassNotFoundException(error);
} catch (SQLException cnfe) {
error = "SQLException: Could not connect to database";
throw new SQLException(error);
} catch (Exception e) {
error = "Exception: An unknown error occurred wile connecting " + "to database.";
throw new Exception(error);
public void disconnect() throws SQLException {
try {
if ( con != null ) {
con.close();
} catch (SQLException sqle) {
error = ("SQLException: Unable to close the database connection.");
throw new SQLException(error);
public ResultSet viewBooks() throws SQLException, Exception {
     ResultSet rs = null;
     try {
          String queryString = ("SELECT * FROM Book;");
Statement stmt = con.createStatement();
rs = stmt.executeQuery(queryString);
} catch (SQLException sqle) {
error = "SQLException:Could not execute the query.";
throw new SQLException(error);
return rs;
//public static void main (String [] args){
//     System.out.println("Hello");     
I just want to display a simple view page
<%@ page language="java" import="java.sql.*, java.io.*, java.util.*, com.wrox.databases.*"%>
<jsp:useBean id="book" class ="com.wrox.databases.Books" />
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Buy Now Bookshop</title>
</head>
<body>
     <h1> Buy Now Bookshop </h1>
     <h2> View Books </h2>
     <b>Add More Books</b>
     <form action="delete.jsp" method="post">
          <table border="1">
          <tr>
          <td><b>ID:</b></td>
          <td><b>Title:</b></td>
          <td><b>Price:</b></td>
          </tr>
     <%
          book.connect();
          ResultSet rs = book.viewBooks();
          while (rs.next()) {
     %>          
<tr>
<td>
     <input type="checkbox" name="pkey"
          value="<%=rs.getString("Title_ID")%>"/>
          </td>
          <td><%= rs.getString("Title") %> </td>
          <td><%= rs.getString("Price") %> </td>
          </tr>
     <%
     %>
</table>
Check books for deletion.<BR>
<input type="submit" value="Delete All Checked Books">
</form>
<% book.disconnect(); %>
</body>
</html>
Can anyone help please????

Please check it.
http://forum.java.sun.com/thread.jsp?forum=45&thread=356467&tstart=0&trange=30
Hope it helps.
Hafizur Rahman
SCJP

Similar Messages

  • HELP Mac OS X Deleted cannot locate hard drive to install on

    Okay I have a 12' in Apple PowerBook G4 I got in winter 2003 and recently somehow the operating system got deleted. It originally came with Mac OS X Jaguar 10.2.7 and I upgraded it to Mac OS X Panther 10.3 -- at the time the problem occurred it was running 10.3.9 Ran Apple Hardware Test using PowerBook CD. I used the Quick Test and it found an error. It suggested I shut down, turn it back on and during restart run Apple Hardware Test again having disconnected all peripherals which I have done -- it now wants me to run the Extended test. I will do so and report the results below. When trying to access Disk Utility to repair the disk the only discs it found were the installation discs I put in the drive. The internal hard drive did not appear. So not only did Mac OS X get erased but the drive to install it on does not show up during the installation process. When I try to run from the main disk I get the Finder error that Mac OS cannot be found.
    Okay it is running the Apple Hardware Test Extemded Test for PowerBook version 2.0.5
    Elapsed time was 54 seconds. The error code is **ERROR*CODE***ERROR*CODE**2STF/1/4; **ERROR*CODE***ERRORCODE
    AirPort: No device found
    Logic Board: Passed
    Mass Storage: Error Detected
    Memory: Has not been run yet
    Modem: Device found
    Video RAM: Has not been run yet

    Thanks -- I was afraid of that. I called AppleCare and they said the same thing. Unfortunately, this PowerBook as I think I mentioned earlier -- in case I didn't though I got it in November of 2003 and as such by now the warranty would have expired. Second, I lost my Apple serial number for the PowerBook which is bad when needing to get support from Apple on the product.
    I'll likely as soon as possible buy a new Apple laptop. Most likely a MacBook or a MacBook Pro as I need an optical disc drive (MacBook Air for me is a non starter) as such a new Apple laptop would be cheaper than repairing the existing PowerBook. With the current recession and the bad housing market I'm going to wait a while and then replace it. Just curious if anyone knows what is Apple's policy on buying back old products that don't work anymore. Do they have a recycling program for their Macs also? I know there is one for recycling old iPods.

  • Why is it not showing anything after I plugged in my USB hard drive? I cannot locate the drive in my macbook. FYI this happened after few times using it.

    I need help as I am new to IOS.
    Currently it is not showing anything after I plugged in the hdd to my mac book.

    I had the same exact issue, which you can see in another forum.
    I "killed" both my MBP and my wife's MBP by plugging in my iPhone and getting a  message about USB drawing too much power.
    It was not fixed by using an SMC reset.
    I DID fix it by unplugging the battery, I left it unplugged long enough to remove the RAM, HD and put some RAM and HD back into place. (I initially swapped the RAM and HD from my MBP into my wife's MBP.
    After that everything was good, although upon first boot, some apps crashed because of the "system date" being set to a date before 2000. I forget the exact date, but it will be some time in 1984, the birthdate of the Macintosh. It is not a big issue, just correct the date and time.
    If you are curious about that date, copy a large file on your drive and look at the CREATED/MODIFIED date....it will show this same date, until the copy is complete, at which time you will see the correct one.
    Once again, try to disconnect your battery, very carefully by lifting up the connecter evenly on both sides to avoid damaging the connector or the board.

  • When I export to disc, lightroom 5 tells me it cannot locate a drive that supports burning eventhough I have the capability

    What changes do I need to make?   Lightroom 5 is not recognizing a drive capable of supporting burning when exporting to disc

    Select one of the movies in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder Window should open with the file selected.
    Does it?

  • I am using a late 2008 macbook and have recently purchased a WD Passport Ultra 1TB to use for storage.  I have formatted the drive and successfully moved files onto the drive, however now I am unable to locate the drive within FINDER. Please HELP!

    I am using a late 2008 macbook and have recently purchased a WD passport ultra 1TB drive to use as storage.  I have successfully formatted the drive, and moved files from macbook onto it, however now I cannot locate the drive within FINDER, even though it is showing within disc utility.  Please HELP!!!!

    Welcome to Apple Support Communities
    Open a Finder window, and your external drive should show up in the sidebar, under "Devices".
    A different way is to go to Finder menu (in the menu bar) > Preferences > General, and tick "External disks". If your external drive is detected by OS X, it will show up at the top right corner of Desktop, so double-click it to access to the content.

  • When I download photos from a flash drive,everything is fine and they show in Events and Pictures, but when I click on the individual pic I get an error message saying that it cannot locate the JPG. Any thoughts?

    When I download photos from a flash drive,everything is fine and they show in Events and Pictures, but when I click on the individual pic I get an error message saying that it cannot locate the JPG. Any thoughts?

    It sounds like your iPhoto Advanced preferences are set to not copy photos during import, i.e. a Referenced library:
    Check your Advanced preferences to see if that's the case. If it is the best solution would be to select the checkbox to copy the photos and reimport the photos from the flash drive.  Then check the new import. It it was OK you can delete the previous event with the "missing" photos.
    OT

  • Itunes cannot locate my files on the external hard drive - I changed preferences but still not locating songs?

    itunes cannot locate my files on the external hard drive - I changed preferences but still not locating songs?

    This work for the most part:
    https://discussions.apple.com/message/20361846#20361846

  • How to point Itunes to a new location where music is stored Cannot locate music now it is on an external drive PLEASE HELP!!!!

    Background Info
    i have recently got rid of my Windows machine an am now using my MacBook as my main machine  
    On the old windows Desktop   i had my music set up as follows  
    Itunes libary information:
    C:\Documents and settings\Lee Robinson\My Documents\My Music\
    all of the Music files were stored on the PC as follows  
    G:\Music\My Music
    Before i got rid of the machine i backed up all of my music and my iTunes libary files as follows to a External USB Harddrive that is now connected to my mac
    Music Located @
    /Volumes/AFRO-PORT/My Music
    the iTunes Libary is located at the following  
    /Volumes/AFRO-PORT/My Music/iTunes
    what i then did was to copy  my itunes libary files at  /Volumes/AFRO-PORT/My Music/iTunes  to my local Mac machine .....
    /Users/Afroboy/Music
    Problem
    Now when i fire up Itunes, i have all my playlists, ratings abum art etc...... but the problem i have is that itunes cannot locate any of the files. I guess that this is because my entire libary is still pointing to
    G:\Music\My Music -  as on my old windows PC
    How do i tell itunes that this is no longer where i keep my music and for the actual MP3 files itself it needs to look at the following path
    /Volumes/AFRO-PORT/My Music
    ... all file structures within these 2 file directories remain the same  
    I would really appreciate the heklp-  my music collection is quite big and i dont want to loose any of the work i have done building it up over the past 5 years  
    Cheers
    LR

    Hi  - thanks for the response  
    yes thats right, i have always kept my itunes folder and the directory containing all of my actual media seperate  
    all of the Music files were stored on the PC as follows:  
    G:\Music\My Music
    Itunes libary information:
    C:\Documents and settings\Lee Robinson\My Documents\My Music\
    Your quite right, doing the above method that i have, turns it really messy when you  when you try to move your entire collection. i saw this article earlier today 
    iTunes: How to move your music to a new computer - http://support.apple.com/kb/HT4527
    ..........wish i followed it before hand  
    The only Semi work arond i have found is to go to File> Add libary.... and brows to what is now my new external drive with all my music on  /Volumes/AFRO-PORT/My Music/ .
    Once the import was complete it effectivly dupicated my entire libary -  So i then went to
    File > Display Duplicates to show duplicate items, sorted by date and removed all the duplicate items  
    .... So far seems to have worked ok however i have lost my play lists, their all on my iPod anyway so all seems fine now  
    As you said iTunes wants you to do thinngs in a certian way and it certianly makes you pay if you dont. So now my question is, so i dont have this problem in the future..... do i
    A) Manually move all of my Music files to my iTunes Liabry and have everything in one folder (If i move manually where do i need to copy all my files to?)
    B) Start from Scratch and let iTunes do it, so i have everything on the external disk    

  • HT201625 All my media is on a portable hard drive.  The drive letter has changed, and now my library cannot locate anything.  Is there a quick way to re-link the library to the new drive location?

    All my media is on a portable hard drive.  I installed Itunes on a new computer, and scanned the portable hard drive, thus creating a new library on the new computer.  The portable drive now has a different drive letter.  Now, the library cannot locate any of the songs because when it was created it (I assume) linked to the other drive letter.  Now, from what I understand, I can select a (song, album etc) and then browse to the new location.  But I have thousands of songs.
    I need a way to re-identify as the whole group.  And because this is a portable hard drive, this could happen on a daily basis, so I know there must be some other process I am missing.  I guess I could delete the library and rescan the drive and create a new library every time I reconnect the hard drive, but that seems inefficient and time consuming.  Oh, Windows 8.1 and Itunes 12.1.1.4, if that matters. 
    Am I missing some simple step to this?

    See turingtest2's user tip on Make a split library portable - the best approach is to have the complete library (database, artwork, etc. as well as media) on the external drive.  This layout is not only robust against changes in drive letters, but also means that the external drive can be used with any system running iTunes - just hold down SHIFT while starting iTunes and select the library on the external drive.
    A quick fix, of course, is to use Windows' Disk Management facilities to reset the external HDD's drive letter to match the locations stored in the iTunes database.

  • Itunes cannot locate files stored on external hard drive

    I use a maxtor external hard drive for my music storage(f:itunes) with 7000 songs on it. My Itunes library all of a sudden stopped locating the files. Through forum posts, I used advanced/change file location to f:itunes, and the only way I could hear the songs was to open the f drive and individually click on each file.
    I thought using library/consolidate library would solve this problem, now I have 2 or 3 copies of each song. Some of them play (with Fdrive connected) while others still show the cannot locate source message. When I tried a few songs I deleted the ones that would not play when clicked on, while keeping the ones that did. After deleting, the original ones now won't play.
    How do I get my original set up to work, with Itunes library on my laptop to only display 1 track not 2 or 3, and play from the source files contained on my external HD? The other puzzling thing is when I connect my external drive, the prompt that asks what you want to do with the Maxtor displays a "F:\ access denied" message. Is this the main cause of my issues?

    Well, before you wipe out your library and start all over, there is something to try.
    You have to have the option set for itunes 'keep itunes folder organized' checked.
    Change the location back to the default by pressing the reset folder location.
    You will get a message asking if you want itunes to copy everything to match your settings. For god's sake, do NOT say yes or it will copy everything onto your C: drive.
    Let it do its stuff. Then when it is finished, change the setting back to F:
    +i-tunes music folder location to F:\mp3s+
    Again, do NOT answer that question as yes.
    Depending on how large your library is, this can take a while. My library has 27K tracks and it takes over a half hour. But you might get the links back. What this does is force itunes to look at all the paths.

  • PDFMaker cannot locate the Adobe PDF Printer's printer driver. Please re-install Adobe Acrobat 10.1

    The following error message appears when I try to create a PDF in Publisher:
    PDFMaker cannot locate the Adobe PDF Printer's printer driver. Please re-install Adobe Acrobat 10.1.
    I have tried update patches to no avail.
    Can anyone please help?
    Thank you.
    Susan

    This is the forum for Adobe Reader (not Acrobat). If you have Reader, you won't have that driver. If you have Acrobat, you'll want to ask in that forum: http://forums.adobe.com/community/acrobat

  • How to delete movie files i cannot locate on my flash drive

    I am almost at my limit of flash drive storage because I have downloaded a few tv shows on itunes on my macbook air. I have deleted these on itunes and emptied trash but still on my system profiler it shows about 11GBof movies taking up space. I cannot locate any movie files having tried looking first at my itunes library and also on finder searching by file type. A mystery to me where these files are.
    How can I get rid of those movie files?

    Install AIR browser from app world. The PB file manager is a joke.

  • I have a MacBook Pro and it cannot locate my Western Digital External Backup Drive.

    I have a MacBook Pro and it cannot locate my Western Digital External Backup Drive.  It used to work prior to Maverick but now it doesnt.  Do I need a different cord or what can I do so I can use Time Machine with this drive?

    Your problem is really with "Time Machine", backup software included with OS X since version 10.5, not with your Time Capsule router.  For more information on Time Machine, check these Web pages:
    Time Machine FAQs
    Time Machine Troubleshooting

  • I have just purchased a canon pima iX6550 . However I cannot locate the software or driver anywhere , including the installation disk . It keeps referring me to the manufacturer.

    I have just purchased a canon pima iX6550 . However I cannot locate the software or driver anywhere , including the installation disk . It keeps referring me to the manufacturer.

    I believe the included disk had you go online to Canon and get updated drivers from there.  This is important as the newest driver seems to have a fix for problems with the printer and OSX Lion.

  • ITunes cannot locate purchased music.  It was stored on an external hard drive that has crashed.  How can I recover the songs?

    iTunes cannot locate purchased music.  It was stored on an external hard drive that has crashed.  How can I recover the songs?

    Hello, nwestpha. 
    Thank you for visiting Apple Support Communities. 
    You may find this article helpful in locating your missing media.
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/TS1408
    Cheers,
    Jason H.

Maybe you are looking for

  • Screen rotation not working in iso 5.0.1 ver

    Screen rotation is not working in ios 5.0.1 ver in ipad2 with 3g please help

  • JAVA+UNIX+MS_ACCESS

    Anybody knows how to connect to a MsAccess DB located in a unix server ? I tried with jdbc:odbc, but not connect. Thnx !

  • Item 050 Order 600491 budget exceeded

    Budget maintained for particular asset 1,000,000.00  and assigned 833,903.21 I have created PR with that PR i am creating capitalPO, at the time of saving its showing an error Item 050 Order 600491 budget exceeded Message no. BP604 In document item 0

  • XML Section Group(INPATH)

    I have the below 2 xml files. When i am trying to query using inpath the pattern matches for both xmls and so pulls the data from both the xml's but i want to grab the data from xml1 which is Exact matching data. The query pulls the data even if it f

  • Need music to play through more than 1 slide ...

    I'm new to Mac. I've used PowerPoint and was able to have music play until it ran out. I've edit music to fit my slideshow exactly and I'm using multiple music files in one slideshow. When I add music it stops once it transitions to the next slide. H