Time of Update: 2018-12-04
做過很多的項目,我們通常需要通過一點設計模式來解決一些稍微複雜的問題。比如說讀取一個data,有多行資料檔案。在讀取過程中可能會出現些特殊情況,要求是,假如出現以外情況,需要把已經讀取的資料寫到資料庫裡,而出錯的位置需要記錄在系統中,下次讀取的時候從這個位置往下,這個記錄出錯位置並且下次執行,這些基礎的服務,可能是在架構中做處理,而不需要讓編寫業務程式的程式員知道這些。 設計:可能我們只需要寫一個IBaseBatchController介面,提供一些開放的介面。供程式員使用,可能是這樣的pub
Time of Update: 2018-12-04
今天tomcat啟動就出錯了嚴重: End event threw exceptionjava.lang.IllegalArgumentException: Can't convert argument: nullat org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:999)at
Time of Update: 2018-12-04
在做java列表匯出excel時檔案名稱一直亂碼,經實驗下面兩種方法都可解決問題response.setHeader("Content-Type","application/msexcel");response.setContentType("application/octet-stream;charset=UTF-8;");response.setHeader("Content-Disposition", "attachment;filename="+new String(filename,"
Time of Update: 2018-12-04
用JNI實現執行個體:建立HelloWorld.javaclass HelloWorld{private native void print();public staticvoid main(String[] args){new
Time of Update: 2018-12-04
文章有錯誤,我要報錯 到論壇交流、討論 對該文章進行評論 進入VIP視頻站下載視頻--java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source)
Time of Update: 2018-12-04
【轉:】 1. 概述 很多正在開發或者打算開發XML Web
Time of Update: 2018-12-04
package untitled1;import java.awt.*;import javax.swing.JPanel;public class Bean1 ...{ public static void run() ...{ Runtime rt = Runtime.getRuntime(); Process p = null; try ...{ p = rt.exec("F:/Net/組織機構/電子政務資料交換/ConvertData/ConvertDa
Time of Update: 2018-12-04
private String addcwform(String recordsumid) { CallableStatement proc = null; Connection conn = null; try { conn = DBUtil.getConn(); proc = conn.prepareCall("{ ? = call cwnew_pack.addCwform(?) }"); proc.registerOutParameter(
Time of Update: 2018-12-04
在jsp中,中文亂碼常會讓人心亂如麻。一般的解決方案一、本頁顯示問題"<%@ page contentType="text/html;charset=GB2312"%>"二、提交問題鑒於此問題,你可以將讀出來的字串進行轉換,這很簡單:str = request.getParameter("s");str = new String(str.getBytes("ISO-8859-1"),"GBK");或者設定request.setCharacterEncoding("GBK"); 然而,
Time of Update: 2018-12-04
如遍曆 Map<A,B> map Set<Entry<Integer,String>> vs = urlMapping.entrySet();Entry<Integer,String> entry = null;for(Iterator<Entry<Integer,String>> iter=vs.iterator();iter.hasNext();){entry=iter.next();int episode =
Time of Update: 2018-12-04
最近做的幾個項目技術上面都使用JAVA,於是我這個JAVA半吊子開始稍微比較系統的瞭解JAVA。 這篇文章是我短期內對j2ee下開發的一點感觸。 我自己曾經一直“引以為傲”的以“C++程式員”自居(雖然我自己在C++上的造詣也未必深刻),但是一直有種C++程式員的“王者氣派”,認為無論在效率上、設計上、文法複雜度上,能做C++是很值得吹噓的一件事情。對一些WEB上的技術甚至很浮躁的“不屑為之”。 其實當我走進JAVA的開發世界的時候,卻有了很多不同以往的感觸,確實:實踐才是檢驗真理的唯一標準啊。
Time of Update: 2018-12-04
經常有需求,一個數組,用其他串連符串連起來。貌似沒有特別好用的串連工具,自己寫了一個,分享出來。import java.util.ArrayList;import java.util.List;/** * @author chenggong * mux string with connector * * * @param <T> */public class StringMuxer<T> {public String mux(List<T>
Time of Update: 2018-12-04
import java.io.Reader;import java.sql.Clob;public class ClobTransfer { /** * 將String轉成Clob ,靜態方法 * * @param str * 欄位 * @return clob對象,如果出現錯誤,返回 null */public static Clob stringToClob(String str) {if (null == str)return null;else {try
Time of Update: 2018-12-04
1、文法: 這個還行,基本的東西都敲過幾年了,差不多吧。不過有些不常用的還是有些混淆。比如有個 transit?2、命令:我好像只用過javac 、java 和 javaw.其它的命令這幾年加在一起應該不超過10次。3、工具:用過Jbuilder 和 Eclipse. 不算熟悉,好多東西都是看別人用才學來的。4、API大部分常用的能記住,包括方法。不過Eclipse的內建的javadoc提示還不錯。而且我自己整理了java 6.0的API, 供自己快速尋找。5、測試:偶爾用,一般的程式根本不用,
Time of Update: 2018-12-04
1、判斷迴文數public class IsHuiWen{public static void main(String[] args){IsHuiWen(121);//isHuiwen(12344);}//總結今天的面試題,就是看一個正整數是不是迴文數//方法1,將數字翻轉,如果和原來的數字相同,則是迴文數static boolean isHuiWen(int num){if(num < 0){return false;}int origin = num;int n =
Time of Update: 2018-12-04
public class Fact {//求n!階層問題public static int fact(int num) {if (num == 0)return 1;elsereturn num * fact(num - 1);} // 使用遞迴演算法求得元素中的最大數public static int findMaxNumber(int arr[], int low, int high) {int max;if (low == high) {return arr[low];} else
Time of Update: 2018-12-04
package com.csmzxy.rjxy.j2se.array_collection_04;public class LinkedListTest { private static int size; private Node header = null;// 表示為頭結點 public LinkedListTest() { header = new Node(null, null); size = 0; } public
Time of Update: 2018-12-04
1、十進位轉化為N進位Integer.toBinaryString(int i)//返回的是i的二進位表示,傳回型別為StringInteger.toString(int i,int radix)//返回的是i的二進位表示,傳回型別為String,但是負數不適用。Integer.toHexString(int i)//返回16進位Integer.toOctalString(int i)//返回8進位System.out.println(Integer.toBinaryString(5));//1
Time of Update: 2018-12-04
質數又稱素數。在自然數中,只有1和它本身兩個約數的數叫做質數。也就是說在自然數中,除了1和此整數自身外,不能夠被其他自然數整除的數,稱之為質數public class SwapTest { public static boolean isPrimer(int number){ if(number <= 1 ) return false; //判斷素數的演算法,i不需要迴圈到n for(int i=2;i<Math.sqrt(number);++i){ if(
Time of Update: 2018-12-04
方法1public class Node {int data;Node next = null;public Node(int data){this.data = data;}public static Node reverseSingleLink(Node head){Node front = null;Node succ = null;Node p = head.next;//不知道是不是如果不帶頭結點,就是p = head了?還是搞不清楚頭結點這個東西。while(p !=