The moose likes JDBC and the fly likes Unable to connect to MS SQL Server using JRun drivers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Unable to connect to MS SQL Server using JRun drivers" Watch "Unable to connect to MS SQL Server using JRun drivers" New topic
Author

Unable to connect to MS SQL Server using JRun drivers

Subbu Aswathanarayan
Ranch Hand

Joined: Jun 22, 2001
Posts: 73
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.
any help is greatly appreciated.
Subbu

Subbu
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
try use JDBCODBC driver


Senior software engineer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to connect to MS SQL Server using JRun drivers