生成exe文件后出现的问题
各位大侠:
小弟的测试的过程中,
需要上传文件过数据库.
public class DBFactory {
private static String CLASSNAME =
"com.microsoft.jdbc.sqlserver.SQLServerDriver";
private static String databaseURL =
"jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=DatabaseName";
private static String user = "sa";
//private static String password = "";
private static String password = "";
private static DatabaseDAO factorydao = null;
//是否是第一次联接,做报错提示使用
public static boolean isfirstcon = true;
public static boolean stop = false;
static ConnectionFactory cf = null;
..........
}
测试程序运行没有问题,但是生成exe文件后,运行exe文件
就出现如下问题.提示是:
C:\Documents and Settings\hua\桌面\11111.txt
connection factory 创建!
java.lang.ClassNotFoundException: com/microsoft/jdbc/sqlserver/SQLServerDriver
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at util.connectionpool._Connection.<init>(_Connection.java:44)
at util.connectionpool._Connection.getConnection(_Connection.java:117)
at util.connectionpool.ConnectionFactory.<init>(ConnectionFactory.java:71)
at util.DBFactory.getDao(DBFactory.java:82)
at dao.Luckdao.GenerateLuckyTable(Luckdao.java:44)
at ris_lucky.ris_luckyFrame.jButtonupload_actionPerformed(ris_luckyFrame.java:158)
at ris_lucky.ris_luckyFrame_jButtonupload_actionAdapter.actionPerformed(ris_luckyFrame.java:
227)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
.......
请大侠们请教/谢谢