2014-01-01から1年間の記事一覧
APIにput/getがないので、bufferをread/writeすることになります。 import java.io.File; import java.io.IOException; import org.apache.log4j.Logger; import com.trilead.ssh2.Connection; import com.trilead.ssh2.ConnectionMonitor; /** * SSH-2接続…
public static String string2Hex(String src) { StringBuffer sb = new StringBuffer(); try { for (byte b : src.getBytes("Windows-31J")) { String s = Integer.toHexString(0xff & b); if (s.length() == 1) { sb.append("0"); } sb.append(s); sb.appe…
public class AccountExampleExtension extends AccountExample { protected Criteria createCriteriaInternal() { return new CriteriaExtension(); } public static class CriteriaExtension extends AccountExample.Criteria { /** * アカウントテーブル…
結局、別案となるが調べたのでメモ。 /** * WAS EJBリモートアクセスの場合 */ public void loginServiceRemote() throws Exception { Hashtable<String, String> pdEnv = new Hashtable<String, String>(); pdEnv.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitial</string,></string,>…
private String Hoge#fuga(String arg) の場合 Hoge hogeClass = new Hoge(); Method fugaMethod = hogeClass.getClass().getDeclaredMethod("fuga", new Class[] {String.class}); fugaMethod.setAccessible(true); String ret = (String) fugaMethod.invok…