当前位置: 技术问答>java相关
Exception in thread "main" java.lang.NoClassDefFoundError: test01
来源: 互联网 发布时间:2015-04-02
本文导语: 连接SQLSERVER2000,第4种类型驱动已经安装。 代码 import java.sql.*; public class test01 { public static void main(String agrs[]) { String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"; String url ="jdbc:microsoft:sqlserver://192.168.1.37:1433";...
连接SQLSERVER2000,第4种类型驱动已经安装。
代码
import java.sql.*;
public class test01
{
public static void main(String agrs[])
{
String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url ="jdbc:microsoft:sqlserver://192.168.1.37:1433";
String user ="sa";
String pass ="msdn";
try
{
Class.forName(driver);
}
catch(Exception E)
{
System.out.println("can not find driver");
E.printStackTrace();
}
try
{
Connection con=DriverManager.getConnection(url,user,pass);
if(!con.isClosed())
import java.sql.*;
public class test01
{
public static void main(String agrs[])
{
String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url ="jdbc:microsoft:sqlserver://192.168.1.37:1433";
String user ="sa";
String pass ="msdn";
try
{
Class.forName(driver);
}
catch(Exception E)
{
System.out.println("can not find driver");
E.printStackTrace();
}
try
{
Connection con=DriverManager.getConnection(url,user,pass);
if(!con.isClosed())
代码
import java.sql.*;
public class test01
{
public static void main(String agrs[])
{
String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url ="jdbc:microsoft:sqlserver://192.168.1.37:1433";
String user ="sa";
String pass ="msdn";
try
{
Class.forName(driver);
}
catch(Exception E)
{
System.out.println("can not find driver");
E.printStackTrace();
}
try
{
Connection con=DriverManager.getConnection(url,user,pass);
if(!con.isClosed())
import java.sql.*;
public class test01
{
public static void main(String agrs[])
{
String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url ="jdbc:microsoft:sqlserver://192.168.1.37:1433";
String user ="sa";
String pass ="msdn";
try
{
Class.forName(driver);
}
catch(Exception E)
{
System.out.println("can not find driver");
E.printStackTrace();
}
try
{
Connection con=DriverManager.getConnection(url,user,pass);
if(!con.isClosed())
|
CLASSPATH中包括当前目录了吗?