生成exe文件后出现的问题

CN40618 2006-02-28 03:53:31
各位大侠:

小弟的测试的过程中,
需要上传文件过数据库.
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)
.......

请大侠们请教/谢谢
...全文
121 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
crazycy 2006-03-03
  • 打赏
  • 举报
回复
jar文件路径的问题;exe默认exe文件所在的目录是当前目录,sqlserver的三个lib包的应该在当前目录下寻找

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧