본문 바로가기
반응형

프로그래밍/웹 프로그래밍13

[iBATIS] The column index is out of range: 1, number of columns: 0 아래와 같은 메시지가 출력 된다면... javax.servlet.ServletException: --- The error occurred in /sql/board.postgresql.xml. --- The error occurred while applying a parameter map. --- Check the ArticleProperties. --- Check the parameter mapping for the 'idnum' property. --- Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0. org.apache.struts.chain.ComposableReques.. 2007. 9. 10.
struts + iBATIS + DBCP 사용하기 struts와 iBATIS를 사용하기 위해 몇일 동안 씨름한 결과이다. 기본 동작만 확인 했으므로 보는 이에 따라 확장 가능할 것이다 ^^ iBATIS와 struts의 설치는 간단하기도 하거니와 이미 인터넷에 많은 자료가 있으니 그쪽을 참고하기 바란다. 여기에서는 iBATIS를 이용해 DB에서 객체로 가져와 struts에서 사용하는 것에 목적이 있다. 테스트를 위해 다음과 같은 순서로 user를 가져온다. DB -> iBATIS -> struts -> 웹 당연히 이 순서는 개념만 있는 것이다. DB에 연결을 하자. /WEB-INF/classes에 sqlmap-config.xml 파일에 DB를 연결한다. 두번째 줄에서 볼 수 있듯이 실제 DB 설정 파일은 ./config/database.properties.. 2007. 8. 27.
[JSP] 날짜 포멧에 맞추어 가져오기 먼저 아래와 같은 패키지가 필요하다. import="java.util.*" import="java.text.*" 그리고 아래와 같이 코딩한다. Calendar cal = Calendar.getInstance(); Date currentTime = cal.getTime(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd HH:mm:ss"); String ndate = formatter.format(currentTime); (이 코드는 http://kiwibug.tistory.com/2 에서 가져옴) 이렇게 하면.. SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd HH:mm:ss"); 위의.. 2007. 7. 19.
[JSP] How to use JDBC for PostgreSQL I can't write in korean right now -_-; 1. download jdbc driver from here. 2. Simply you should put the driver in $CATALINA_HOME/webapps/ROOT/WEB-INF/lib. 3. restart your tomcat. I'll show you simple jsp code. 2007. 7. 11.
반응형