工具包中代码:package util;import java.sql.*;public class DBUtil { public DBUtil() { } public static Connection getConnection() { String URL ...
分类:
其他好文 时间:
2015-01-06 17:07:13
阅读次数:
223
首先,Java中的getResourceAsStream有以下几种:
1. Class.getResourceAsStream(String path) : path 不以’/'开头时默认是从此类所在的包下取资源,以’/'开头则是从ClassPath根下获取。其只是通过path构造一个绝对路径,最终还是由ClassLoader获取资源。
2. Class.getClassLoader.ge...
分类:
编程语言 时间:
2015-01-06 15:39:03
阅读次数:
232
1.url:
要求为String类型的参数,(默认为当前页地址)发送请求的地址。
2.type:
要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和delete也可以使用,但仅部分浏览器支持。
3.timeout:
要求为Number类型的参数,设置请求超时时间(毫秒)。此设...
分类:
Web程序 时间:
2015-01-06 15:37:10
阅读次数:
115
本地连接:string strConnect = "Provider=MSOLAP; Data Source=localhost;Initial Catalog=Analysis Services Tutorial;Integrated Security=SSPI;";网络连接方式:string s...
分类:
数据库 时间:
2015-01-06 15:24:21
阅读次数:
178
//可以设置指定那一天:例如,最近一周,参数传入-7,最近一月,参数传入-30...private String getBeginDate(int date) throws ParseException { SimpleDateFormat sdf = new SimpleDateFo...
分类:
编程语言 时间:
2015-01-06 15:22:34
阅读次数:
319
上代码:string dt = " 1 11 1961"; DateTime day;System.Globalization.DateTimeFormatInfo dtFormat = new System.Globalization.DateTimeFormatInfo(...
1.在类的里面添加 //写配置文件 [DllImport("kernel32")] private static extern long WritePrivateProfileString(string section, string key, string val, s...
分类:
编程语言 时间:
2015-01-06 15:08:07
阅读次数:
191
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2015-01-06 15:03:38
阅读次数:
157
public static void main(String[] args) { ?? ???? List strList = new ArrayList(); ?? ???? strList.add("one"); ?? ???? strList.add("two"); ?? } ?? ?? ?? 相信很多人都有过...
分类:
编程语言 时间:
2015-01-06 13:55:50
阅读次数:
210