Redian新闻
>
How to insert image to DB2 ?
avatar
How to insert image to DB2 ?# Database - 数据库
s*i
1
dear all :
How to insert image in a table of DB2 ?
please tall me,thank you !!
avatar
q*e
2

The best way for you is to go to
http://www.redbooks.ibm.com
and search all db2 materials(input db2 to search), choose
associate platform and tools you use.
If you use java, you can also go to
http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/index
.html
and read "Using SQL3 Datatypes" for more detail.

【在 s******i 的大作中提到】
: dear all :
: How to insert image in a table of DB2 ?
: please tall me,thank you !!

avatar
f*h
3
An example in Java:
Suppose you have a table (id varchar, image blob)
public static void loadImage(Connection con, String fileName, String
tableName, String idValue){
File imageFile;
try{
imageFile = new File(fileName);
} catch (Exception e) {
System.out.println("File not found!");
return;
}
String queryString = "INSERT INTO "+tableName+" VALUES(?,?)";

try{
PreparedStatement pstmt =
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。