Using Java/JSp on ISP machine (Any Ideas Please)

Tomcat works fine on my ISP Host the problem however is that you usually do not have control over classpath for all the jar files.
+ Can any one please suggest alternative ways to use jar file
+ Example of what I want to solve is my isp does not have jdbc-odbc
it comes up with this error
java.sql.SQLException: [unixODBC][Driver Manager]Data source name not found, and no default driver specified
Therefore I want to just insert the jar file for the bridge and use it to connect in my jsp or java bean file.
Any ideas please
Thanks in advance

Here is the code used to connect
<%@ page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
     <title>Untitled</title>
</head>
<body>
<%
            String username;
            String password;
            username="bbbb";
            password="cccc";
            try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            // set this to a MS Access DB you have on your machine
            String filename = application.getRealPath("/data/loger.mdb");
            String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
            database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
            // now we can get the connection from the DriverManager
            Connection con = DriverManager.getConnection( database ,"","");
            Statement s = con.createStatement();
            int i=0;
System.out.println(i);           
//        s.execute("create table MyCustomers (CustomerID integer , ContactFirstName varchar(15),  ContactLastName varchar(20))"); // create a table
System.out.println(i+=1);           
System.out.println(i+=1);    
        String query = "SELECT * FROM Customers WHERE username='"+username+"' AND password='"+password+"'";      
        s.executeQuery(query); // select the data from the table
System.out.println(i+=1);          
        ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query
            if (rs != null) {
                out.println("Customer Data: <br>");
                while ( rs.next() )
                    out.println(rs.getString(3));                       
                    out.println(rs.getString(4)+"<BR>");                       
                    session.setAttribute("userId", rs.getString(1));
                    session.setAttribute("userName", rs.getString(17));
            out.println("Database connected");
        s.close(); // close the Statement to let the database know we're done with it
        con.close(); // close the Connection to let the database know we're done with it
            out.println("Database Disconnected");
            catch (Exception e) {
                out.print(e);
%>
</body>
</html>

Similar Messages

  • When i try to use facetime on my imac it comes up with facetime not responding and starts to use nearly 2gb of memory. Any ideas please?

    when i try to use facetime on my imac it comes up with facetime not responding and starts to use nearly 2gb of memory. Any ideas please?
    Also messages does the same thing

    Hello BassoonPlayer,
    Since you are using one of the the school's Macbooks, it is quite possible that the time and date are not properly set on the computer that you are using.  FaceTime will not work if you do not have the proper time zone set up for the location that you are in.  This past week, there were a two other Macbook users I've helped by simply telling them to set the Date/Time properly.  By the way, you described your problem very well, which makes it easier for us to help you.  Hope this solves your problem -- if not, post back and I can suggest other remedies.
    Wuz

  • HT4061 i bought an unlocked iphone 4s in the UK, am now living in Thailand. cannot use phone on AIS simm card. any ideas please?

    iphone 4s bought from a friend in Uk. phone unlocked. unable to use phone in thailand, is there anything i have to do to get the phone working. have put a AIS sim card in the 4s, it comes up, activation failed, carrier not supported. do i try another sim card from a different carrier, how do i find what carriers are supported on this iphone? do i need to take the phone to a shop for unlocking to this carrier? any info would be very helpful. many thanks

    It seems as though the iPhone is not unlocked from the carrier. You need to contact the UK carrier the iPhone is locked to and ask them if they can unlock the iPhone as they are the only ones who can unlock it.

  • I am having problems with migration assistant (windows pc to Mac 2011) When I get to the 'Quit other applications' box and click continue, nothing happens. There are no other apps running - any ideas, please?

    I am having probems with migration assistant. Trying to transfer data from a windows laptop to iMac 2011. It was working fine when I did the set-up yesterday, but it was going to take hours to transfer some videos so I quit the process with the intention of doing it again at a later stage. However today I find that everytime I get to the 'Quit other applications' box on the Mac and click 'continue', nothing happens. Have checked mission control and confirmed no other apps running. Tried several times with the same result every time. Migration Assistant running on my laptop with the 'Waiting for mac to connect' box displayed. Mac is connected to wi-fi OK as able to use Safari and access internet. Any ideas, please?

    Thanks for your suggestions. Have managed to get Migration Assistant working but now have a new problem, i.e. where does it save the transferred files?!! Searched a few forums and it seems it saves it under your old username, or suchlike. Anyway I tried logging on as a new user using my old user name but there were only a handful of files there, couldn't locate the majority of stuff from my old laptop. Anyway I don't intend to go through any more hoops with MA - will just save the important stuff to an external drive and transfer it that way. Not impressed with MA at all. I thought it was supposed to be a user-friendly tool to simplify the transfer from pc to Mac - not my experience, I'm afraid!

  • Photoshop v7.0 I get the error "missing or invalid personalization information"  This used to run, I'm now on Windows 7 64 bit.  Anyone have any ideas please?  Thanks.

    I get the error "missing or invalid personalization information"  This used to run, I'm now on Windows 7 64 bit.  Anyone have any ideas please?  Thanks.

    Hi,
    If my memory serves me right (it’s some while since I changed and I have not used Photoshop for some years…) I was running it on XP.  I upgraded to Win 7 on  a new machine but ported across files, programmes etc.  I cannot recall if Photoshop ever ran on Win 7.
    I have tried to reinstall but the CD is warped and despite applying pressure to it neither of my drives likes it.  I have Photoshop 7 on my third hard drive, a portable drive, which came from the XP machine.
    Sorry, long-winded but I hope it helps.

  • Been using iTunes for about 2 years on the same MacBook Pro, just opened it and found everthing's gone. It's as if I'd never used it before. Any ideas, please?

    Been using iTunes for about 2 years on the same MacBook Pro, just opened it and found everthing's gone. It's as if I'd never used it before. Any ideas, please?

    Simply restore from your backup.
    You do have Time Machine running, yes?
    Or you use some other backup program?

  • I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    Hi mafiose15,
    Thanks for visiting Apple Support Communities.
    Restoring your iPod to factory settings is the best way to try and get it back to working order. You can use the instructions below to restore it:
    How to restore iPod
    Verify that you have an active Internet connection, because you may need to download new versions of the iTunes and iPod Software.
    Download and install the latest version of iTunes if necessary.
    Open iTunes. Connect your iPod to your computer using the USB or FireWire cable that came with your iPod.
    After a few moments, your iPod will appear in the Source panel in iTunes.
    Select your iPod in the Source panel. You will see information about your iPod appear in the Summary tab of the main iTunes window.
    Click Restore.
    If you are using a Mac, you will be asked to enter an administrator’s name and password.
    A progress bar will appear on the computer screen, indicating that stage one of the restore process has begun. When this stage is done, iTunes will present one of two messages with instructions specific to the iPod model you are restoring.
    Disconnect iPod and connect it to iPod Power Adapter (typically applies to older iPod models).
    Leave iPod connected to computer to complete restore (typically applies newer iPod models).
    During stage two of the restore process, the iPod displays an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remain connected to the computer or iPod power adapter during this stage.
    Note: The progress bar may be difficult to see, because the backlight on the iPod display may be off.
    After stage two of the restore process is complete, the iTunes Setup Assistant window will appear. It will ask you to name your iPod and choose your syncing preferences, as it did when you connected your iPod for the first time.
    You can find the instructions in this article:
    Restoring iPod to factory settings
    http://support.apple.com/kb/ht1339
    All the best,
    Jeremy

  • I have a Mac Pro using OSX 10.7.4.  When using apple mail I click on the address icon to obtain email address and nothing happens.  I've restarted both the application and the Mac but still won't open address book.  Any ideas please.

    I have a Mac Pro using OSX 10.7.4.  When using apple mail I click on the address icon to obtain email address and nothing happens.  I've restarted both the application and the Mac but still won't open address book.  Any ideas please.

    Assuming you have these accounts set up in Mail, open preferences and under Accounts tab, edit the SMTP outgoing server list. Do you have a .mac address in the list? If so, delete it.
    Are you using iCloud?
    For the troubled account, select the correct SMTP server for that account in the box and check the box to use only that server with that account.

  • The word app has disappeared from my desktop computer and can't be found on finder or search. All documents I created on word will now not open unless in "TextEdit" format which I don't use. Any ideas please? Thanks

    The word app has disappeared from my desktop computer and can't be found on finder or search. All documents I created on word will now not open unless in "TextEdit" format which I don't use. Any ideas please? Thanks

    Did you recently erase and/or reinstall the OS?
    And, some details are needed: model/year Mac, Mac OS version running now and which version originally).

  • Hello I use Mac pro with OSX 10.9.9 I am trying to download flash player but I keep getting this "Install Adobe Flashplayer" is Damaged and can't be opened anyone got any ideas please

    Hello I use a macbook pro with OSX 10.9.5. I am trying to download Flash player but keep getting this message "Install Adobe Flashplayer" is damaged and can't be opened.You should eject the disk image.Any ideas please?

    You should make sure you do a complete uninstall of the flash player first and then install the latest FP14 version from this link - Use http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player_osx.dm g
    In order to do a complete uninstall - Uninstall Flash Player | Mac OS

  • The wifi i have been using for months quit working yesterday. any ideas how to fix this?

    the wifi i have been using for months quit working yesterday. any ideas how to fix this?
    HELP!!!

    Is your Wi-Fi visible?
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    iOS: Troubleshooting Wi-Fi networks and connections
    Did you check your router?
    iOS: Recommended settings for Wi-Fi routers and access points

  • My iphone4 says its cinnected to 3g but when i use safari it says "could not activate mobile data network". Any ideas please?

    my iphone4 says its cinnected to 3g but when i use safari it says "could not activate mobile data network". Any ideas please?

    Further, if you are not in your home cellular carrier's area, you need to set Settings > General > Cellular > Data Roaming = "On".

  • I'm using CS5 Indesign Mac it keeps crashing when Saving or Saving As. Uninstalled and the Reinstalled program and it still crashes. Takes over 60 seconds to unfreeze. I'm using Lion 10.7.5. Any ideas?

    I'm using CS5 Indesign Mac it keeps crashing when Saving As. Uninstalled and the Reinstalled program and it still crashes. Takes over 60 seconds to unfreeze. I'm using Lion 10.7.5. Any ideas?

    reset your preferences -
    after effects:  http://helpx.adobe.com/after-effects/using/preferences.html
    flash:  http://helpx.adobe.com/flash/kb/re-create-preferences-flash-professional.html
    illustrator:  http://helpx.adobe.com/illustrator/using/setting-preferences.html
    indesign:  https://forums.adobe.com/thread/526990
    photoshop:  https://forums.adobe.com/thread/375776

  • When I use Preview my computer locks up. Can't use it to view PDFs. Any ideas?

    When I use Preview my computer locks up. Can't use it to view PDFs. Any ideas?
    I try to save files as a PDF on external hard drives. When I select SAVE AS PDF I get spinning colorwheel and the program I am using locks (Quicken, Quickbooks, Gmail etc.)

    There were several /Library/preferences. The only one that had the file was the one under my user name. I deleted it. I was using Quickbooks when the problem started. It is locked. I have to reboot the computer to use it again. I tried SAFARI using the PRINT button then SAVE AS PDF. It didn't work. It locks Safari up. I will reboot and hopefully continue.
    P.S. I've done this procedure before and I was able to Save, but then the problem came back.

  • TS2755 Since a recent general software upgrade when I double click Home button circular icons of contacts appear above the miniature page. I would like to stop this. It never used to occur and I am not keen on it now ! Any ideas please ?

    After recent software upgrade. When I double click home button and pages miniaturist,I now get circular icons of contacts above Messages page. I never used to get this and would like to remove them. Any ideas please ? Thank you in advance

    Go to settings> mail, contacts, calendare> show in app switcher> off.

Maybe you are looking for

  • Queries Running Under the JOB

    Hi, At OS level one porocess is taking more CPU how to find the query running under that process. 5 ? *15581* oracle 241 20 7776M 8704K run 6:58 *99.97* 99.79 oracleCORE 3 ? *24777* oracle 241 20 7781M 16240K run 79:31 *99.50* 99.32 ora_j001_CORE How

  • Steps Involved in creating Users thru the API

    Hi Mark or anybody from Oracle, Your solution to build a string for the XML and then parse it is ok. However I would like to do it programmatically instead of building strings containing the XML. What are the steps and exactly what attributes do you

  • Dear Experts ,

    i m facing error in idoc to jdbc scenario . when i executed sm58 then showing this error No RFC authorization for function module IDOC_INBOUND_ASYNCHRONOUS  except this everything working fine . please give me solution .

  • DPS6: hiding attributes for entries not matching a specific objectclass

    I'd like to be able to hide some attributes, but only for entries not matching a given objectclass. DPS 6 allows data hiding rules to apply to a specific subset of entries, but the subset can not be defined thanks to a negative filter such like (!(ob

  • Create,move Oracle Retail Merchandising system Database users to IOD

    Hi All, RMS v12.0.6; OS: AIX 5.3 64 bit Could anyone please let me know the following: 1.What's the process to create,move Oracle Retail Merchandising system Database users to IOD? 2.In R12, is "appsweb.cfg" located in FORMS_WEB_CONFIG_FILE is used f