Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to connect to MS SQL Server using JRun drivers

 
Subbu Aswathanarayan
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dorj Galaa
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try use JDBCODBC driver
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic