2008서버에 xml데이터형으로 존재하는 컬럼을 select하는데
SQL server management studio로 해당 컬럼을 select하면 데이터가 존재하는데...
JDBC드라이버(sqljdbc4.jar)를 이용하여 해당 컬럼을 select하면 null값으로 나옵니다.
cast , convert / nvarchar(max)로 변환을 해도 값을 못갖고 오네요...
해당 xml 데이터형 컬럼의 값은 jsp소스의 내용을 긁어 넣은 값들이 들어가 있구요...(xml형태의 데이터는 아닙니다.)
- 더 궁금한것은 JDBC를 이용하여 select했을 경우 해당 컬럼의 모든 값이 null로 나오는것은 아니고 일부는 값이 나오고 일부는 null로 나오고 있어 데이터를 비교했을때도 특별한 차이가 없어서 난감한 상황입니다.
도움을 부탁 드립니다.
혹시나 해서 해당 컬럼의 데이터의 일부는 아래와 같습니다.
(xml 데이터형 컬럼 값 발췌)
<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=euc-kr"><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><style>body {font-family : 굴림,굴림체, Arial, Microsoft Sans Serif;font-size : 9pt;background-color:transparent;color : #4444;scrollbar-face-color: #D4D0D0; scrollbar-shadow-color: #F5F4F4;scrollbar-highlight-color:#F5F4F4; scrollbar-3dlight-color: #FFFFFF;scrollbar-darkshadow-color: #FFFFFF; scrollbar-track-color: #F5F4F4;scrollbar-arrow-color: #gray}textarea {font-family : 굴림;font-size : 9pt;color : black;}td {font-family : 굴림;font-size : 9pt;color : black;}a:visited {font-family : 굴림;font-size : 9pt;color: #8E8E8E;text-decoration : none;}a:link,active {font-family : 굴림;font-size : 9pt;color: #0033cc;text-decoration : none;}Input, Select {font-family: 굴림;font-size: 9pt;vertical-align : middle;text-decoration: none;border:1x solid #D5DADF;}#text_contents { font-family: 굴림; font-size: 12px; color: #181818; text-decoration: none; line-height: 18px; border: 2px #EFF3F6 solid; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px}#text_contents a:link{color: #1344A7; text-decoration: none}#text_contents a:visited{color: #1344A7; text-decoration: none}#text_contents a:hover{font-family: 굴림; font-size: 12px; color: #1344A7; text-decoration: underline}#text_contents a:active{font-family: 굴림; font-size: 12px; color: #1344A7; text-decoration: underline}#staticcell {font-family : 굴림,Arial, Microsoft Sans Serif;font-size : 9pt;color : #333333;background-color : #E6E9EB;line-height : 18px;}#staticcell_font {font-family : 굴림,Arial, Microsoft Sans Serif;font-size : 12pt;color : #333333;line-height : 18px;}#staticcell_no {font-family : 굴림,Arial, Microsoft Sans Serif;font-size : 9pt;color : #333333;line-height : 18px;}#staticcell_sub {font-family : 굴림,Arial, Microsoft Sans Serif;font-size : 9pt;color : #333333;background-color : #F2F4F5;line-height : 18px;}#contentcell {font-family : 굴림,Arial, Microsoft Sans Serif;font-size : 9pt;color : #333333;padding-left: 4px;background-color : #FFFFFF;line-height : 18px;}#contentcell a:link{font-family: 굴림; font-size: 9pt; color: #000000; text-decoration: none}#contentcell a:visited{font-family: 굴림; font-size: 9pt; color: #000000; text-decoration: none}#contentcell a:hover{font-family: 굴림; font-size: 9pt; color: #000000; text-decoration: none }#contentcell a:active{font-family: 굴림; font-size: 9pt; color: #000000; text-decoration: none }#contenttext {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;color : #636363;line-height : 18px;}#contenttexttmp {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;color : #546599;background-color : #EDF1FC;line-height : 18px;}#aprcontentcell {font-family : 굴림,Arial, Microsoft Sans Serif;font-size : 9pt;color : #546599;background-color : #EDF1FC;line-height : 18px;}#aprBasicInfoTitle {font-family: 굴림, Arial, Microsoft Sans Serif;font-size: 9pt;color : #2A2A8C;background-color : #E1E8FC;vertical-align:middle;text-align:center;line-height : 23px;}#aprInfoContent {font-family : 굴림, Arial, Microsoft Sans Serif;font-size: 9pt;color : #3232A6;background-color : #EDF1FC;vertical-align:middle;text-align:center;line-height : 23px;}#aprStatusContent {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;color : #3232A6;background-color : #EDF1FC;vertical-align:top;text-align:center;line-height : 23px;}#aprPlusInfoTitle {font-family : 굴림, Arial, Microsoft Sans Serif; font-size : 9pt;color : #2A2A8C;background-color : #E1E8F7;vertical-align:middle;text-align:center;line-height : 23px;}#aprBottomComment {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;vertical-align:middle;text-align:center;line-height : 23px;}#aprContentComment {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;vertical-align:middle;text-align:left;line-height : 20px;}#aprCenterComment {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;vertical-align:middle;text-align:center;line-height : 20px;}#aprRightComment {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;vertical-align:middle;text-align:right;line-height : 20px;}#aprLeftContent {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;color : #3232A6;background-color : #EDF1FC;vertical-align:middle;text-align:left;line-height : 23px;}#aprPlusInfoTitle_app {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;color : #000000;background-color : #ffffff;vertical-align:middle;text-align:center;line-height : 23px;}#aprInfoContent_app {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;color : #000000;background-color : #ffffff;vertical-align:middle;text-align:center;line-height : 23px;}#contentcell_app {font-family : 굴림, Arial, Microsoft Sans Serif;font-size : 9pt;color : #3232A6;background-color : #EDF1FC;line-height : 23px;}</style>
</head>
<!--서식별 히든 필드 시작-->
<div style="display:none">
</div>
<!-- Start Body -->
<!-- Body -->
<script>
...생략
xml컬럼 형식이 있는걸 처음 알았네요..
NVARCHAR(MAX)나 TEXT등으로 하시면 되거 같은데 굳이 xml형식도 아닌데 xml 데이터 타입으로 넣는 이유가 있나요?