|
-
May 31st, 2004, 03:54 AM
#1
Thread Starter
Lively Member
java to MS SQL
i'm new to this thing. sorry for bothers but i want to know what did i miss? i have this code throwing an exception of com.microsoft.jdbc.sqlserver.SQLServerDriver
PHP Code:
import java.sql.*;
public class JdbcExample3{
public static void main(String args[]){
Connection conn=null;
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
conn=DriverManager.getConnection(
"jdbc:microsoft:sqlserver:///northwind");
if(!conn.isClosed())
System.out.println("sucessfully connected to sql server...");
}
catch(Exception e){
System.err.println("Exception: "+e.getMessage());
}
finally{
try{
if(conn!=null) conn.close();
}
catch(SQLException e){}
}
}
}
i installed the j2sdk1.4.0, microsoft sql server 2000 for jdbc driver and the ms sql 2000.
-
Jun 1st, 2004, 01:40 AM
#2
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 1st, 2004, 01:46 AM
#3
Thread Starter
Lively Member
yo, corned... this is the output, an exception...
Exception: com.microsoft.jdbc.sqlserver.SQLServerDriver
thanx for the reply...
-
Jun 1st, 2004, 02:58 AM
#4
Can you give the output of e.printStackTrace() ?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 1st, 2004, 03:09 AM
#5
Thread Starter
Lively Member
Code:
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at JdbcExample3.main(JdbcExample3.java:7)
-
Jun 1st, 2004, 03:15 AM
#6
The JDBC driver is not installed properly and not found by the Java runtime.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 1st, 2004, 03:30 AM
#7
Thread Starter
Lively Member
i'll just try to download the driver again or maybe find another one... thanx corned. just have to search more. thanx so much...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|