본문 바로가기

Languages/Java

Java-HTTPS 통신 (링크) http://tjjava.blogspot.kr/2012/03/https.html http://java2go.net/blog/197 간단한 예제 HTTPS Client 프로그램입니다. 물론 아래의 예제를 사용하면 인증서 관련 에러가 발생될 수 있습니다. 이에 관련하여 아래의 포스팅을 참고해 주세요. http://devbada.tistory.com/366 package foo; import java.net.URL; import java.io.*; import javax.net.ssl.HttpsURLConnection; public class JavaHttpsExample { public static void main(String[] args) throws Exception { String httpsURL =..
Java-HTTPS 주소의 파일 다운로드 HTTPS 건 HTTP건 일반적인 환경에서 URL 접속은 대게 아래와 같이 사용하고 있습니다. URL url = new URL("https://hostname:port/file.txt"); URLConnection connection = url.openConnection(); InputStream is = connection.getInputStream(); // .. then download the file 하지만 HTTPS 환경에서는 server 인증서가 없거나 지정하지 않을 경우 아래와 같은 오류를 만나게 됩니다. avax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed:..
JAVA-현재 시간의 날짜 간단하게 표현하기 JAVA 의 System 클래스와 Calendar, SimpleDateFormat 클래스를 이용하여, 현재 날짜 및 시간을 가져올 수 있습니다. 간단하게 아래와 같이 작성할 수 있고, 1: long startTime = System.currentTimeMills(); 2: System.out.println("현재 시간: " + new Timestamp(startTime()); 혹은 아래와 같이 사용자의 편의에 따라 사용할 수 있습니다. 1: Calendar calendar = Calendar.getInstance(); 2: 3: SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); 4: 5: System.out.println("..
Bad version number in .class file` faultDetail:`null` { 자바에도 해당되는 내용이며, 플렉스에서 자바를 사용할 때도 마찬가지로 해당되는 내용입니다.클래스 파일을 컴파일하고자 할때, JDK의 버전이 맞지 않을 때 생기는 문제이며,프로젝트의 .settings 폴더내의 org.eclipse.jst.common.project.facet.core.prefs 파일의아래 내용을 확인하여 수정하면 됩니다.#Sat Sep 19 15:57:21 KST 2009 classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jdk150_19/owners=jst.java\:5.0 classpath.helper/org.eclip..
JAVA excute / excuteUpdate / excuteQuery 차이점 생각없이 코딩하다가 ㅡ_ㅡ;;오류 부딫히면 힘들다는 것을 오늘도 깨닫고 갑니.....★ excute / excuteUpdate / excuteQuery 차이점출처 : http://j79sw.tistory.com/216
JAVA - JDBC, Supported Database, JDBC Drivers, and Deployment Containers Supported Databases, JDBC Drivers, and Deployment ContainersNetBeans Visual Web Pack 5.5 is tested on the following databases and drivers:Oracle Driver / Oracle DatabaseMicrosoft Driver / SQL Server DatabaseIBM Driver / DB2 DatabaseMySQL Driver / MySQL DatabaseDataDirect / Oracle/SQLServer/DB2/SybaseOracle driver tested on the Oracle database:Driver LocationOracle Database 10g Release 2 JDBC Dri..
JAVA - PreparedStatement 로 한글 2000자 입력하기. 오라클의 VARCHAR2 타입에서 입력 가능한 최대 크기는 4KB(4000Byte)인데, 영문은 1Byte로서 4,000자. 한글은 2Byte로서 2,000자를 넣을 수 있습니다.하지만, 문자열의 길이를 byte로 계산하기 때문에 한글과 같이 2바이트 이상을 사용하는 경우에는 실제 이론상의 길이보다 훨씬 적게 들어갑니다.PreparedStatement 인스턴스에서 setString() 으로 문자열을 지정할 경우에 그러한데, 내부적으로 문자를 UTF-8로 변환해서 길이가 4KB를 넘는지 보게 됩니다.영문의 경우 2바이트로 계산해서 최대 2천자까지 들어가나, 한글의 경우 UTF-8에서 문자당 3바이트(?)를 차지하므로 입력 가능한 문자의 개수는 666자(1998 바이트)에 불과합니다.해결책은 setStrin..
JAVA - 설정된 java class path 정보 확인하기. 자바 소스에서 아래의 소스를 이용하여, 운영체제에 설정된 자바 Class Path 정보를 확인할 수 있습니다.String strClassPath = System.getProperty("java.class.path");[출처] http://blog.naver.com/PostView.nhn?blogId=corpsemixer&logNo=30010678812&parentCategoryNo=8&viewDate=¤tPage=1&listtype=0