jbuilder 2006使用问题
我写了一个类package leaveword;
import java.sql.*;
import java.text.*;
import java.util.Date;
public class connectionDB
{
String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url = "jdbc:microsoft:sqlserver://127.0.0.1:1433;Database = Test_DB";
String user = "sa";
String password = "sa";
Connection conn = null;
public connectionDB()
{
}
public Connection getConn()
{
try
{
Class.forName(driver);
conn = DriverManager.getConnection(url,user,password);
}
catch(Exception e)
{
e.printStackTrace();
}
return conn;
}
public String getDate()
{
String datestr = "";
SimpleDateFormat df = new SimpleDateFormat("yy/mm/dd hh:mm");
Date date = new Date();
datestr = df.format(date);
return datestr;
}
public static void main(String[] args)
{
connectionDB connectiondb = new connectionDB();
System.out.print("ok!!!");
}
}
运行是报警如下,为什么?
ljava.lang.NoClassDefFoundError: leaveword/connectionDB
Exception in thread "main"