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!
Try running it as a java application (using main() ) and see what happens.
David
"Tom" <Tstal...@yahoo.com> wrote in message
news:c1f60ca7.03082...@posting.google.com...