Background Image

FORUM

조회 수 47429 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

* 질문 등록 시 다음의 내용을 꼭 기입하여 주세요.
OS
Window7 32bit, Linux 64bit 등
CUBRID Ver.
[cubrid_rel] 수행 결과
CUBRID TOOL Ver.
[도움말]-[버전정보] 확인
응용 환경(API)
java, php, odbc 등 입력

* CUBRID 응용 오류, SQL 오류 또는 SQL 튜닝 관련된 문의는 반드시 다음의 내용을 추가해 주세요. 비밀글이나 비밀 댓글도 가능합니다.
* 저희가 상황을 이해하고, 재현이 가능해야 알 수 있는 문제들이 많습니다. 가능한 정보/정황들을 부탁합니다.
에러 내용 및 재현 방법 재현 가능한 Source와 SQL
관련 테이블(인덱스, 키정보 포함) 정보 CUBRID 홈 디렉토리 아래 log 디렉토리 압축


-------------- 아래에 질문 사항을 기입해 주세요. ------------------------------------------------------------------------
전자정부표준프레임워크를 이용해서 이미지를 BLOB으로 저장할려 합니다.

context.xml

<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true" />

<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">

<property name="configLocation" value="classpath:/egovframework/sqlmap/config/cubrid/sql-map-config-cubrid-cmm.xml"/>

<property name="configLocations">

<list><value>classpath:/egovframework/sqlmap/config/cubrid/*.xml</value> </list>

</property>

<property name="dataSource" ref="dataSource"/>

<property name="lobHandler" ref="lobHandler"/>

</bean>

sql-map-config.xml

<typeHandler callback="org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler" jdbcType="BLOB" javaType="[B" />


controller

final MultipartFile file = multiRequest.getFile("mainImage");

byte[] b = FileCopyUtils.copyToByteArray(file.getInputStream());

commandMap.put("image", b);

commandMap.put("fileNm", file.getOriginalFilename());

//commandMap.put("image", file.getBytes());


쿼리는

INSERT 

 INTO  TM_COLLECTIONINFO

    (  MUSEUM_ID, 

IMAGE, 

EXHIBIT_FLAG, 

FILE_NM

    )

  ]]>

VALUES

    (  #ssmuseumId#, 

#collectId#, 

...


BIT_TO_BLOB(#image#),

#exhibitFlag#,

#fileNm#

    )


1. 이상태로 실행하면 저장은되나 쿼리브라우저로 확인하면 256b만 저장되어 이미지를 확인할수 없습니다

2. 쿼리에 BIT_TO_BLOB 은 맞는건지요?

BIT_TO_BLOB 이걸 빼고 실행하면 

--- The error occurred in egovframework/sqlmap/collregmng/reg/ArchiveDataReg/CollectionList_SQL.xml.  

--- The error occurred while applying a parameter map.  

--- Check the CollectionListInfo.insertCollectionInfo-InlineParameterMap.  

--- Check the statement (update failed).  

--- Cause: cubrid.jdbc.driver.CUBRIDException: CASID[1],CASPID[9316],SESSION[203079],URL[jdbc:cubrid:192.168.103.31:33000:archive:archive:********:?charset=utf-8]

Semantic: Cannot coerce host var to type blob. ]; SQL was [] for task [SqlMapClient operation]

이런 에러가 납니다


3. 쿼리 에서 이미지지 넣을때

#image:BLOB# 와 #image# 어떤게 맞는건지요..?

:BLOB를 넣으면 아래와 같은 에러가 납니다.


2013-10-23 16:41:22,466  INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]

2013-10-23 16:41:22,469 DEBUG [org.springframework.beans.factory.xml.DefaultDocumentLoader] Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]

2013-10-23 16:41:22,470 DEBUG [org.springframework.beans.factory.xml.BeansDtdResolver] Found beans DTD [http://www.springframework.org/dtd/spring-beans-2.0.dtd] in classpath: spring-beans-2.0.dtd

2013-10-23 16:41:22,473 DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] Loading bean definitions

2013-10-23 16:41:22,491  INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [sql-error-codes.xml]

2013-10-23 16:41:22,492 DEBUG [org.springframework.beans.factory.xml.DefaultDocumentLoader] Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]

2013-10-23 16:41:22,493 DEBUG [org.springframework.beans.factory.xml.BeansDtdResolver] Found beans DTD [http://www.springframework.org/dtd/spring-beans-2.0.dtd] in classpath: spring-beans-2.0.dtd

2013-10-23 16:41:22,495 DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] Loading bean definitions

2013-10-23 16:41:22,496  INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] Found custom sql-error-codes.xml file at the root of the classpath

2013-10-23 16:41:22,499 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'DB2'

2013-10-23 16:41:22,499 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'DB2'

2013-10-23 16:41:22,500 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'DB2' to allow for resolving potential circular references

2013-10-23 16:41:22,505 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'DB2'

2013-10-23 16:41:22,505 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'Derby'

2013-10-23 16:41:22,505 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'Derby'

2013-10-23 16:41:22,505 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'Derby' to allow for resolving potential circular references

2013-10-23 16:41:22,506 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'Derby'

2013-10-23 16:41:22,506 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'H2'

2013-10-23 16:41:22,506 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'H2'

2013-10-23 16:41:22,506 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'H2' to allow for resolving potential circular references

2013-10-23 16:41:22,506 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'H2'

2013-10-23 16:41:22,506 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'HSQL'

2013-10-23 16:41:22,506 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'HSQL'

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'HSQL' to allow for resolving potential circular references

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'HSQL'

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'Informix'

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'Informix'

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'Informix' to allow for resolving potential circular references

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'Informix'

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'MS-SQL'

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'MS-SQL'

2013-10-23 16:41:22,507 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'MS-SQL' to allow for resolving potential circular references

2013-10-23 16:41:22,508 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'MS-SQL'

2013-10-23 16:41:22,508 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'MySQL'

2013-10-23 16:41:22,508 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'MySQL'

2013-10-23 16:41:22,508 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'MySQL' to allow for resolving potential circular references

2013-10-23 16:41:22,508 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'MySQL'

2013-10-23 16:41:22,508 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'Oracle'

2013-10-23 16:41:22,508 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'Oracle'

2013-10-23 16:41:22,509 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'Oracle' to allow for resolving potential circular references

2013-10-23 16:41:22,509 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'Oracle'

2013-10-23 16:41:22,509 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'PostgreSQL'

2013-10-23 16:41:22,509 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'PostgreSQL'

2013-10-23 16:41:22,509 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'PostgreSQL' to allow for resolving potential circular references

2013-10-23 16:41:22,517 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'PostgreSQL'

2013-10-23 16:41:22,517 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'Sybase'

2013-10-23 16:41:22,517 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'Sybase'

2013-10-23 16:41:22,517 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'Sybase' to allow for resolving potential circular references

2013-10-23 16:41:22,517 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'Sybase'

2013-10-23 16:41:22,547 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'CUBRID'

2013-10-23 16:41:22,547 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating instance of bean 'CUBRID'

2013-10-23 16:41:22,547 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'CUBRID' to allow for resolving potential circular references

2013-10-23 16:41:22,548 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'CUBRID'

2013-10-23 16:41:22,551  INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, CUBRID]

2013-10-23 16:41:22,551 DEBUG [org.springframework.jdbc.support.SQLErrorCodesFactory] Looking up default SQLErrorCodes for DataSource [org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@de1520]

2013-10-23 16:41:22,557 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Fetching JDBC Connection from DataSource

2013-10-23 16:41:22,557 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Fetching JDBC Connection from DataSource

2013-10-23 16:41:22,650 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Returning JDBC Connection to DataSource

2013-10-23 16:41:22,650 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Returning JDBC Connection to DataSource

2013-10-23 16:41:22,650 DEBUG [org.springframework.jdbc.support.SQLErrorCodesFactory] Database product name cached for DataSource [org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@de1520]: name is 'CUBRID'

2013-10-23 16:41:22,650 DEBUG [org.springframework.jdbc.support.SQLErrorCodesFactory] SQL error codes for 'CUBRID' found

2013-10-23 16:41:22,650 DEBUG [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] Unable to translate SQLException with Error code '0', will now try the fallback translator

2013-10-23 16:41:22,651 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Returning JDBC Connection to DataSource


수많은 글을 찾아보고 여기도 다보앗습니다.

메뉴얼도 받지만 그걸로는 방식이 달라 참조를 못하겟습니다,,

전자정부표준프레임워크를 이용해서 blob으로 저장할수잇는 방법을 알려주세요.

 



List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 SQLGate for CUBRID 영구 무료 라이선스 제공 file admin 2020.04.09 4262
896 foreign key로 등록하여 다른 테이블에서 참조한 키값을 출력하고 싶습니다.(ER모델) 1 살구맛 2012.10.12 11201
895 큐브리드 List 데이터 타입에 대한, mybatis 연동 방법 문의 2 차오이 2016.03.22 11203
894 9.2 업그레이드 후 spread.datasource가 작동 안함!!!!! 한종희 2014.01.04 11206
893 insert 실행 시 pk 값 return 관련 질문입니다. 2 cuJJANG 2013.06.05 11220
892 큐브리드 REPLACE 함수 사용 1 DarkRanger 2013.02.13 11228
891 큐브리드 설치후, 실행오류 발생 2 챔프 2010.03.08 11229
890 cubrid 암복호화 관련 문의 입니다. 오라클 crypto같은 기능이 있는지요? 1 나라라라 2014.08.07 11243
889 가상화를 이용한 복제기능의 성능이 궁금합니다 1 유니콘 2010.05.27 11250
888 broker 접속 오류 1 단순미학 2009.09.16 11250
887 ODBC 오토커밋 off에 관련된 문의 1 세스카 2012.05.23 11251
886 CUBRID 9.2.0.0.155 한글 깨짐 관련 요청 2 뿡뿡이입니다 2014.02.06 11267
885 Oracle REGEXT 함수 지원하나요? 2 cyber 2013.03.25 11269
884 Connect By Level 구문에 대해 문의 드립니다. 1 깨달음 2012.03.23 11271
883 PHP에서 CUBRID 4.0 모듈이 로드 되지 않습니다. 1 file 유리심장 2011.06.22 11277
882 백업받은 파일로 다른 서버에 복구하기 4 ...... 2009.08.07 11299
881 용량은 충분한데 Out of disk space in database 라는 로그가 남으면서 마이그레이션이 안됩니다. 4 file 리리라 2014.03.20 11301
880 Cubrid에서 Cursor 작성법이 궁금합니다. 4 궁금이 2010.07.09 11305
879 오류 해결방법을 몰라 질문드립니다. 4 삼구 2012.05.16 11307
878 서버를 시작하려는데 시작되질 않네요. 5 까망군 2010.08.25 11309
877 Connection 관련 내용 1 jjobi 2010.08.31 11318
Board Pagination Prev 1 ... 150 151 152 153 154 155 156 157 158 159 ... 199 Next
/ 199

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales