2013年9月28日

java dbcp连接池的使用

摘要: public Connection connOpen() throws SQLException { Connection conn = * null; try { Class.forName("org.sqlite.JDBC"); conn = * DriverManager.getConnection("jdbc:sqlite:" + path); } catch * (ClassNotFoundException e) { e.printStackTrace(); } return conn; } 阅读全文

posted @ 2013-09-28 12:57 qgc 阅读(528) 评论(0) 推荐(0)

2013年9月27日

android adb服务启动不了解决办法

摘要: 在进程里面结束掉 adb 在重启 Eclipse:kill的方法具体如下: 如果cmd找不到adb程序,把android-sdk-windows-r12\platform-tools或者tools下的adb.exe复制的C:盘下System32里面即可: 关掉eclipse 用cmd打开命令行,adb kill-server,最后adb start-server,最后再重启一下eclipse就OK了 阅读全文

posted @ 2013-09-27 23:27 qgc 阅读(497) 评论(0) 推荐(0)

java 对excel操作 读取、写入、修改数据;导出数据库数据到excel

摘要: ============前提加入jar包jxl.jar========================= // 从数据库导出数据到excel public List outPutExcel() { String url= request.getSession().getServletContext() .getRealPath("/") + "upload/"; // 创建文件 File dirPath = new File(ctxPath); if (!dirPath.exists()) { dirPath.mkdir();// 创建文件夹 } List list = excelDao.getInfo(" select x from Xskh ");// 查询数据库导出资料 try { WritableSheet sheet = null; // 创建excel文件 WritableWorkbook book = Workbook 阅读全文

posted @ 2013-09-27 13:12 qgc 阅读(1075) 评论(0) 推荐(0)

2013年9月26日

sqlservice 查询该字段的值是否为数字、不包含a-z字母、获取中文的首字母

摘要: select zjm from xskh where guid_yw='e6ee44f3-98ab-4446-bd9b-db2e525d3b24' and zjm not like '%[ABCDEFGHIJKLMNOPQRSTUVWXYZ]%'--不包含a-z字母 select * from xskh where (ISNUMERIC(aname_long)=1 or isnull(aname_long,'')='')--ISNUMERIC 函数是判断该字段的值是否为数字是=1不是=0 ,但不能判断特殊字符如#、* ----------------------获取中文的首字母------ create function [dbo].[fun_getPY](@str nvarchar(4000)) returns nvarchar(4000) as begin declare @word nchar(1),@PY nvarchar(4000) set @PY='' while len(@str)>0 be 阅读全文

posted @ 2013-09-26 13:12 qgc 阅读(2239) 评论(0) 推荐(0)

2013年9月25日

java复制File文件操作

摘要: ==========================复制File操作=========================================== /** * * @param newPath要赋值的路径 * @param newName新文件名称 * @param oldPath 旧文件路径 * @return error 或者newPath + "/"+newName */ @SuppressWarnings("unused") public static String complyFile(String newPath,String newName,String oldPath){ //String newPath = "WebRoot/WEB-INF/1";// 复制的新路径 //String oldPath = "WebRoot/WEB-INF/ebusiness.db";// 旧文件 try { File file = new File(oldPath); int by 阅读全文

posted @ 2013-09-25 13:00 qgc 阅读(542) 评论(0) 推荐(0)

2013年9月24日

修改Android 程序的icon快捷方式图标和名称

摘要: ,把它改为(“***”表示你放入的图片的名,比如你放入app.png,那么就是android:icon="@drawable/app") 阅读全文

posted @ 2013-09-24 23:20 qgc 阅读(1012) 评论(0) 推荐(0)

2013年9月23日

android打电话、发短信实现

摘要: 打电话: Intent intent = newIntent(Intent.ACTION_CALL,Uri.parse("tel:"+"156666666666")); this.startActivity(intent); 加上打电话的权限: texts =smsM 阅读全文

posted @ 2013-09-23 22:58 qgc 阅读(300) 评论(0) 推荐(0)

J2EE项目相对路径、绝对路径获取

摘要: String path = getServletContext()。getRealPath("/");   这将获取web项目的全路径.   this.getClass()。getClassLoader()。getResource("/")。getPath();   这将获取 到classes目录的全路径   request.getContextPath();   获得web根的上下文环境      jsp 获取文件路径   当前WEB应用的物理路径:   当前你求请的JSP文件的物理路径: %   String path=application.getRealPath(request.getRequestURI());   String dir=new File(path)。getParent();   out.println("当前J 阅读全文

posted @ 2013-09-23 12:43 qgc 阅读(650) 评论(0) 推荐(1)

2013年9月22日

android进度条的使用

摘要: //进度条 class AsyncAdd extends AsyncTask{ private ProgressDialog dialog; public AsyncAdd(Context ctx){ dialog = new ProgressDialog(ctx); //设置进度条风格,风格为圆形,旋转的 dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); //设置ProgressDialog 标题 dialog.setTitle("导入联系人"); //设置ProgressDialog 提示信息 dialog.setMessage("正在导入联系人请稍候...."); //设置ProgressDialog 标题图标 dialog.setIcon(android.R.drawable.ic 阅读全文

posted @ 2013-09-22 12:52 qgc 阅读(291) 评论(0) 推荐(0)

android获取手机的所有通讯录的号码和sim卡号码

摘要: // 获所有手机号码 public List getPhoneContant() { // 取得ContentResolver List list = new ArrayList(); ContentResolver content = getContentResolver(); // 联系人的URI Cursor cursor = content .query(Phone.CONTENT_URI, null, null, null, null); // int contactCount = cursor.getCount(); // 获得联系人数目 if (cursor != null) { while (cursor.moveToNext()) { int columId = cursor .getColumnIndex(ContactsContract.Contacts. 阅读全文

posted @ 2013-09-22 12:44 qgc 阅读(579) 评论(0) 推荐(0)

导航