--------------------------
자바에서 LongRaw 예 --------------------------
1. 읽을때(detail이란 컬럼이 longraw 입니다.)
try{
InputStream vIcode =null;
BufferedReader vvcode =null;
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(" select name,title,detail,re_id,ip,count,to_char(ilsi,'dd/MON/yyyy(hh:mi)'),path,e_mail,root_id,depth from db_board where id = "+szID);
rs.next();
szName = rs.getString(1);
szTitle = rs.getString(2);
szDetail= hangul.han(new String(rs.getBytes(3),0));
szRe_Id = rs.getString(4);
szIp = rs.getString(5);
iCount = rs.getInt(6);
szIlsi = rs.getString(7);
szPath = rs.getString(8);
szE_mail = rs.getString(9);
szRoot_Id = rs.getString(10);
szDepth = rs.getString(11);
iCount++;
rs.close();
stmt.executeUpdate(" update db_board set count=count+1 where id = "+szID);
stmt.close();
}
2. 저장하는 예
PreparedStatement ps = con.prepareStatement("insert into db_board(id,re_id,name,title,detail,passwd,count,ip,ilsi,e_mail,is_re,board_gbn,path,root_id,depth) values (?,0,?,?,?,?,0,?,sysdate,?,'N',?,?,?,0)");
ps.setInt(1,iId);
ps.setString(2,hangul.han(szName));
ps.setString(3,hangul.han(szTitle));
//////////////////////////////////////////////////////////////////////////
StringBuffer szbWriteDetail = new StringBuffer();
for( int i = 0,len=szDetail.length() ; i < len ; i++){
if( szDetail.charAt(i) == ' ')
szbWriteDetail.append(" ");
else if( szDetail.charAt(i) == '<')
szbWriteDetail.append("<");
else if( szDetail.charAt(i) == '>')
szbWriteDetail.append(">");
else if( szDetail.charAt(i) == '\n')
szbWriteDetail.append("<br>");
else
szbWriteDetail.append(szDetail.charAt(i));
}
////////////////////////////////////////////////////////////////////////////
StringBufferInputStream abc = new StringBufferInputStream(szbWriteDetail.toString());
ps.setBinaryStream(4,abc,szbWriteDetail.length());
ps.setString(5,szPasswd);
ps.setString(6,szIp);
ps.setString(7,szE_mail);
ps.setString(8,szBoard_Gbn);
ps.setString(9,szPath);
ps.setInt(10,iId);
ps.executeUpdate( );
기업100%환급/오라클/자바/스프링/안드로이드/닷넷C#/jQUERY개발… | 12-27 | 1639 | ||
[채용예정교육]오라클자바개발잘하는신입뽑기2개월과정,교육전취… | 12-11 | 1165 | ||
53 | [평일주간]100%환급6건,안드로이드,자바,C#,스프링3.2,SQL,힌트/… | 03-15 | 924 | |
52 | [주말주간]C#, ASP.NET마스터 | 01-31 | 1088 | |
51 | [평일,기업100%환급]SQL기초에서 Schema Object까지 | 01-31 | 827 | |
50 | [평일야간]HTML5, CSS3,Ajax, jQuery마스터과정 | 01-31 | 784 | |
49 | [평일주간,평일야간,주말]Spring,MyBatis,Hibernate개발자과정 | 01-19 | 1055 | |
48 | [평일주간,평일야간,주말]안드로이드개발자과정 | 01-11 | 953 | |
47 | [평일야간,주말주간]JAVA,Network&WEB&Framework | 01-03 | 1459 | |
46 | 기업100%환급/오라클/자바/스프링/안드로이드/닷넷C#/jQUERY개발… | 12-27 | 1639 | |
45 | [평일야간,주말]자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis… | 12-19 | 1184 | |
44 | 웹퍼블리싱 마스터(HTML5,CSS3,jQUERY,AJAX,JavaScript) | 12-14 | 1185 | |
43 | [채용예정교육]오라클자바개발잘하는신입뽑기2개월과정,교육전취… | 12-11 | 1165 | |
42 | [평일,기업100%환급]자바기초에서 JDBC, Servlet/JSP까지 | 12-09 | 937 | |
41 | [평일야간]닷넷(C#,Network,ADO.NET,ASP.NET)마스터 | 12-01 | 1095 | |
40 | [기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍(평일주간(단기)… | 12-01 | 1359 | |
39 | [평일야간,주말,주말야간]SQL기초에서실무까지(SQL기초,PLSQL,힌… | 12-01 | 829 |
댓글 없음:
댓글 쓰기