Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / August 2003

Tip: Looking for answers? Try searching our database.

Please Help student with HTTP error

Thread view: 
Tom - 26 Aug 2003 15:47 GMT
Hi everyone,

Okay what im trying to do is make my java program connect to my local
database that is stored on my computer. The database is microsoft sql
2000 and i am using the Microsoft sql server 2000 driver for JDBC.
When i run the program i am getting these errors.

java.lang.ClassNotFoundException: java.io.IOException: open HTTP
connection failed.
       at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:244)
       at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:39)
       at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:135)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:132)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
       at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:109)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
       at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:496)
       at sun.applet.AppletPanel.createApplet(AppletPanel.java:582)
       at sun.applet.AppletPanel.runLoader(AppletPanel.java:511)
       at sun.applet.AppletPanel.run(AppletPanel.java:289)
       at java.lang.Thread.run(Thread.java:479)
load: class BookProject/AddressBook.class not found.

My connection code looks like this

private void connect() throws Exception
  {
    JOptionPane.showMessageDialog(null,"CloudScape Inside Connect");
   
    try
    {
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    Properties p = new Properties();
    p.put("selectMethod","cursor");
    p.put("user","sa");
    p.put("password","a1dragon");
    connection = DriverManager.getConnection
    ("jdbc:microsoft:sqlserver://TOMLAP2:1433",p);
    }
    catch (Exception ex)
    {
       JOptionPane.showMessageDialog(null, ex.toString());
    }
   
         
    try{
     connection.setAutoCommit( false );
     PreparedStatement s1 = connection.prepareStatement("select
'statement1'");
     PreparedStatement s2 = connection.prepareStatement("select
'statement2'");

    }
    catch (Exception ex)
    {
    JOptionPane.showMessageDialog(null, ex.toString());
    }
  }
 

If anyone could offer any help it would be much appreciated.
Thanks for the help!
David Rabinowitz - 27 Aug 2003 14:02 GMT
Are you using the appletviewer or view it inside a browser ? Remember that
applet can open connection to the same host it came from, so the problem
might be in the access rights.

Try running it as a java application (using main() ) and see what happens.

David

> Hi everyone,
>
[quoted text clipped - 7 lines]
>         at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:244)
>         at
sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:39)
>         at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:135)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:132)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
>         at
sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:109)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>         at
sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:496)
>         at sun.applet.AppletPanel.createApplet(AppletPanel.java:582)
>         at sun.applet.AppletPanel.runLoader(AppletPanel.java:511)
[quoted text clipped - 39 lines]
> If anyone could offer any help it would be much appreciated.
> Thanks for the help!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.