Hi,
I have written a simple java code to connect to a MS sql server db.here is the code
import java.sql.*;
import java.io.*;
public class createSecurityTable
{
public static void main(String args[]) throws SQLException
{
String username = "aswaths";
String password = "cufs1";
String url = "jdbc:jrun:sqlserver://servername:1433;databaseName=db";
try
{
Class.forName("allaire.jrun.jdbc.JRunDriver");
// Establish Connection to the database at URL with usename and password
Connection conn = DriverManager.getConnection(url, username, password);
System.out.println ("Ok, connection to the DB is working.");
}
catch(Exception e) // (ClassNotFoundException and SQLException)
{
e.printStackTrace();
}
}
}
i am not getting any compilation error but i am getting this error message while running it.
Exception in thread "main" java.lang.NoClassDefFoundError: allaire/jrun/servlet/JRunSE
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at createSecurityTable.main(createSecurityTable.java:14)
i have no idea why this is happening.
i have the jar file containing the driver in my classpath.
any help is greatly appreciated.
Subbu
[This message has been edited by Subbu Aswathanarayan (edited July 25, 2001).]