Failed to access database through applet! Please help!

Hi there,
I'm writing an applet to connect to a Microsoft Access 97 database situated on the same computer where the applet is invoked.
In appletviewer, it works fine...
appletviewer hello.html -J-Djava.security.policy=policy.plybut how could i get it run on Internet Explorer 5.0?
It always complains about failure to find the class...
Abstract of the program is shown below:
public class TestDB extends JApplet{
     private Connection connection;
     private JTable table;
     public TestDB() {
          String url = "jdbc:odbc:test";
          try {
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               connection = DriverManager.getConnection(url);
          catch (ClassNotFoundException cnfe) {
               System.err.println("Failed to load JDBC/ODBC driver");
               cnfe.printStackTrace();
               System.exit(1);
          catch (SQLException sqle) {
               System.err.println("Connection Err");
               sqle.printStackTrace();
          getTable();
          setSize(450,150);
     private void getTable() {
          Statement st;
          ResultSet resultSet;
          try {
               String que = "SELECT * FROM ChartOfAcct";
               st = connection.createStatement();
               resultSet = st.executeQuery(que);
               displayResultSet(resultSet);
               st.close();
          catch (SQLException sqle) {
               sqle.printStackTrace();
Thank you so much!
Jess

Thank you.
If i were to use a policy file... what should i do to let the browser know about that? Sorry i'm a completey idiot on this.
expected outcome:
typing an URL on the browser, say, http://abc.com/test.html --
an applet will load and the database in the root folder (applet is also in here) would be retrieved.
Thank you.
Jess

Similar Messages

  • I want to display the number of Passed / failed tests in Testtand xml report , please help me

    Hi, I want to display the number of Passed / failed tests in Testtand xml report , please help me.
    My requirement is later i should be able to display these number of passed/failed test in report header too.
    Solved!
    Go to Solution.

    I have attached a sequence to give you an idea of how to get the Result count (I didn't check it's working ), I have used "SequenceFilePostResultListEntry" callback to calculate the Result Count,
    and the Result Count is passed to the "ModifyReportHeader" through File Globals,  where you can edit the XML file to show it in the Repot (follow the link in my previous post).
    Hope this helps
    AshwiN,
    Attachments:
    Get Result Count.seq ‏8 KB

  • I can't access my icloud account , please help

    I can't access my icloud Account, please help .

    How are you trying to access it? You can't access the iCloud website on Safari on an iPad, you have to sign in in Settings>iCloud and access the data through the relevant apps.
    Have you successfully set up an iCloud account? Can you log in at http://icloud.com on a computer? What operating system are you running on your iPad?
    Do you get an error message when you try to access it?
    You really need to post more data with a question like this, just 'I can't access' doesn't really allow for any sort of answer.

  • I have my Calendar app syncing with iCloud.  Every time I open it it says, "Moving Calendars to Server Account..."  It runs and runs and does not stop.  As a result, I cannot access my calendars.  Please help.

    I have my Calendar app syncing with iCloud.  Every time I open it it says, "Moving Calendars to Server Account..."  It runs and runs and does not stop.  As a result, I cannot access my calendars.  Please help.

    I have the same problem, I tried the solution of Dr Cox but that didn't work as he said go to system preference then mail, contacts etc. but I don't have that.  Can someone help?
    Elaine

  • As a new MacBook user I plug in my USB Flash Drive but don't know how to access its contents. Please help. Thanks.

    as a new MacBook user, when inserting my USB Flash Drive, I do not know how to access its contents. Please help. Thanks.

    Open a new Finder window, Finder > File > New Finder Window, and it should appear on the left under Devices.
    If you don't see it there, or to get it to show up on the Desktop: Finder > Preferences... General tab, check External disks to have it show on the Desktop,  Or Sidebar tab, check External disks under DEVICES.

  • When i burn a disk in Disk Utility, the burn completes but the verification process does not complete and my disk pops out. The error message i get is something like this "burn failed because disk cannot be verified," PLEASE HELP

    when i burn a disk in Disk Utility, the burn completes but the verification process does not complete and my disk pops out. The error message i get is something like this "burn failed because disk cannot be verified," PLEASE HELP.
    Also when i take the disk out it seems fine nd everything seems to be burned onto the disk. I am buring mac os x lion onto a disk.
    The disk i am using is nextech and i am burning at the slowest speed (4x).
    Also this is my 3rd time trying to do this and the verifying process keeps failing.... what do i do?

    see there
    http://www.techmixer.com/best-free-mac-burning-software-for-mac-osx/
    what you like most
    try different brand of CD/DVD

  • I have an MS word doc saved from a Macbook in my flash drive. Now i want to print this from an IBM compatible laptop. problem is -- I can't access the file. Please help.

    I have an MS word doc saved from a Macbook Pro on m flash drive. Now i want to print
    th same doc from an IBM Compatible laptop. Problem is, I can't access the file. Please help.

    I suggest you post your question on Microsofts own forums for their Mac products as it's their software you're having issues with:
    http://answers.microsoft.com/en-us/mac

  • I have been able to access a site regularly but in the last few days get a message: "cookies required to access this site." please help, I use this site for work daily:)

    I have been able to access a site regularly but in the last few days get a message: "cookies required to access this site." please help, I use this site for work daily:)

    Goto > Settings > Safari... Enable Cookies > Always
    Good luck!

  • Caonnecting ms access database through tomcat5.5 query

    Hi,
    I have installed tomcat5.5 and jdk1.6 on my machine which has Windows server2003 as OS.
    I'm not able to clearly underdstand the steps in tomcat docs for connecting to database and the changes to be made in different files.
    Can someone tell me detailed and clear steps for connecting to an ms access database through jsp?
    Thanks in advance for your suggestions.

    I'm not exactly sure why you have this problem. I know that the Microsoft SQL Server driver has a parameter "readOnly=false". Check your DB2 docs to see if you need to set a flag like that, too.
    Maybe it has to do with transactions and auto commit. See if DB2 assumes autoCommit true or false. Maybe you have to explicitly commit your INSERT.
    Maybe you're writing to one database and opening another. Make sure that's correct.
    There are other suggestions that I'll offer.
    You do all that work with a database in a constructor? Bad idea.
    You've got database and UI stuff all mingled together. Ever heard of MVC separation?
    Be object-oriented - start by designing an object to encapsulate all those items you're trying to INSERT.
    Then write a Data Access Object (DAO) that does CRUD operations for that object. Test these thoroughly, preferrably with JUnit, until they're 100% perfect.
    Then have a separate UI that instantiates these objects and calls their methods. The persistence layer shouldn't know about UI stuff, and the UI shouldn't need to have any persistence code in it.
    %

  • I try to download my premiere pro, but the installation is interupted at 84%, stating "installation completed though some optional components failed to download correctly (6). Please help!!!!

    i try to download my premiere pro, but the installation is interupted at 84%, stating "installation completed though some optional components failed to download correctly (6). Please help!!!!
    I purchased this tonight and im debating having a refund!

    You may want to try using the Adobe Cleaner Tool and try downloading again:
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • I have dowloaded Photoshop + Lightroom (subscription) but no serial number have been provided for Photoshop CC so I cannot access the product. Please help

    I have dowloaded Photoshop + Lightroom (subscription) but no serial number have been provided for Photoshop CC so I cannot access the product. Please help

    Thank you Steve. Will do it straight away.
    We can can continue talking this evening, no prob.
    Rgds
    Marco
    Il giorno 16/mag/2014, alle ore 19:12, SG... <[email protected]> ha scritto:
    I have dowloaded Photoshop + Lightroom (subscription) but no serial number have been provided for Photoshop CC so I cannot access the product. Please help
    created by SG... in Photoshop General Discussion - View the full discussion
    Hi,
    When did you make the purchase? Can you try signing out of the CC desktop app, and then signing back in?
    I'll see if I can get direct support sent your way as well. How much longer are you available for this evening? We can communicate directly as well if you prefer.
    regards,
    steve
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6385161#6385161
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop General Discussion by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Connecting to database through applet

    hi friends
    I am trying to connect to sql database through applet but I cant.
    in fact it can not connect to database.
    plz any body tell me how can i do this. Thanks

    // class depends on
    //     msbase.jar
    //     mssqlserver.jar
    //     msutil.jar
    // these api's are part of Microsoft SQL Server 2000 Driver for JDBC
    // allso need JNDI file system Service provider: found @ sun http://java.sun.com/products/jndi/#DOWNLOAD12 the JNDI 1.2.X class librarys and
    //          File system provider 1.2 beta 3
    //     fscontext.jar
    //     providerutil.jar
    //      (jndi.jar) provided in java > 1.3*
    // to compile:
    // javac -classpath "C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\j2sdk1.4.2_01\jndi\lib\fscontext.jar;C:\j2sdk1.4.2_01\jndi\lib\jndi.jar;C:\j2sdk1.4.2_01\jndi\lib\providerutil.jar" SQLTest.java
    import javax.sql.*;
    import java.sql.*;
    import javax.naming.*;
    import java.util.Properties;
    public class SQLTest extends Thread {
        String sqlServerUser = "sql login account";
        String sqlServerPWD = "sql password";
        String sqlServerName = "sql machine";
        String sqlServerPort = "1433";
        public SQLTest() {
        public static void main(String[] args) {
            (new SQLTest()).run();
        public void run(){
            Connection conn = null;
            try{
                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://" + sqlServerName + ":"+ sqlServerPort + ";User=" + sqlServerUser + ";Password=" + sqlServerPWD + ";ProgramName=JAVA-jdbc;DatabaseName=Northwind");
                Statement stmt = conn.createStatement();
                ResultSet result = stmt.executeQuery(
                    "SELECT * from [Shippers]"
                if(result.next()){
                    System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                    while(result.next()) {   // for each row of data
                        System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                System.out.println("Getting a connection with drivermanager works fine");
            } catch(Exception e){
                e.printStackTrace(System.out);
            } finally{
                try{
                    conn.close();
                } catch(Exception e){
                    e.printStackTrace(System.out);
            if(true){return;}
    // try it with a datasource
            try{
            // Setting the context:
                com.microsoft.jdbcx.sqlserver.SQLServerDataSource sds = new com.microsoft.jdbcx.sqlserver.SQLServerDataSource();
                sds.setServerName(sqlServerName);
                sds.setDatabaseName("Northwind");
                sds.setNetAddress(sqlServerPort);
                Properties p = new Properties();
                p.put(Context.INITIAL_CONTEXT_FACTORY,     "com.sun.jndi.fscontext.RefFSContextFactory");
                Context ctx = new InitialContext(p);
                try{
                    ctx.unbind("jdbc/EmployeeDB");
                }catch(Exception e){
                }finally{
                    ctx.bind("jdbc/EmployeeDB",sds);
                DataSource ds = (DataSource)ctx.lookup("jdbc/EmployeeDB");
                conn = null;
                conn = ds.getConnection(sqlServerUser,sqlServerPWD);
                Statement stmt = conn.createStatement();
                ResultSet result = stmt.executeQuery(
                    "SELECT * from [Shippers]"
                if(result.next()){
                    System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                    while(result.next()) {   // for each row of data
                        System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                System.out.println("works with datasource");
            } catch(Exception e){
                e.printStackTrace(System.out);
            } finally{
                try{
                    conn.close();
                } catch(Exception e){
                    e.printStackTrace(System.out);
    }To give an applet special privileges you can specify the prifs in the java.policy file or sign the applet and choose "yes I trust" or "yes I allways trust" when the applet is loaded.
    To give special prifs with the java.policy, it should look like this:
    grant {
    permission java.lang.RuntimePermission "usePolicy"; // prevents the popup from showing for signed applets
    grant codeBase "file:C:/-" {
      permission java.security.AllPermission;
    grant codeBase "http://localhost/-" {
      permission java.security.AllPermission;
    };

  • My children enters wrong password several times on problem  my ipad ..., the was it is indicated that it was disabled ... how can i access my ipad thanks please help ... thank you

    my children enters wrong password several times on problem  my ipad ..., the was it is indicated that it was disabled ... how can i access my ipad thanks please help ... thank you

    If it's reached the point where you can't try re-entering the code then you will need to connect the iPad to the computer that you normally sync to and you should then be able to reset the iPad and re-sync your content to it - from http://support.apple.com/kb/HT1212
    If you repeatedly enter the wrong passcode, your iPhone, iPad, or iPod touch will be disabled for longer intervals before you can try again. After too many unsuccessful attempts, you won't be able to try again until you connect it to the computer with which you last synced it.
    You may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808

  • HT204053 After updating my iPad to IOS 7, I can't access my AppStore. Please help.

    After updating my iPad to IOS 7, I can't access my AppStore. Please help. Is it anything to do with ICloud?

    What version of OS X are you using and what version of iTunes? Are you getting any error messages?
    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
    ITunes: Syncing media content to your iOS devices
    http://support.apple.com/kb/ht1351
     Cheers, Tom

  • How to connect my access database using applet?

    hi all,
    i need to connect my access database in my applet program which should work like an atm machine..I dont know how to connect it. Im new to applet same thing in JDBC application. Please help i terribly need it, our deadline in our case study is fast approaching and i still dont know how to do it. I tried the tutorial but i received some sql exception error. thanks!

    Try this link
    http://java.sun.com/docs/books/tutorial/jdbc/basics/

Maybe you are looking for