摘要: 1.如何获得当前文件路径常用:字符串类型:System.getProperty("user.dir");综合:package com.zcjl.test.base;import java.io.File;public class Test { public static void main(String[] args) throws Exception { System.out.println( Thread.currentThread().getContextClassLoader().getResource("")); System.out.prin 阅读全文
posted @ 2006-05-13 23:56 陕北蜂农 阅读(232) 评论(0) 推荐(0) 编辑
摘要: public class Main { public Main() { } public static void main(String[] args) { String fp=Main.class.getResource("").getPath(); System.out.println(fp); //fp就是当前 class 运行的目录 }} 阅读全文
posted @ 2006-05-13 23:52 陕北蜂农 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 1、在 项目管理-->库-->编译--添加Jar/ZIP 添加”mysql 数据库驱动(Driver)“ 本次由于连接MySql5.02 所以,使用mysql-connector-java-5.0.0-beta驱动 mysql-connector 可以从下面的连接下载,或到www.mysql.com 上面下载http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.0.0-beta.zip/from/ftp://ftp.tpnet.pl/d3/ftp.mysql.com/ 2、使用以下代码连接 Cla 阅读全文
posted @ 2006-05-13 00:15 陕北蜂农 阅读(123) 评论(0) 推荐(0) 编辑