|
|
 |
| Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Java Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 2nd, 2007, 12:04 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
how to insert text file in sql server database
Dear Members,
I want to know how to insert text file in sql server database field (having text data type) using java and jdbc technology. i want to store it by java program. As i want to do full text indexing on that field.
plz help me. Waiting for reply!!!!!!!!!!
Regards
sharvari
|

June 4th, 2007, 06:58 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi,
You can use PreparedStatement for this and let the database driver handle the conversion. For example you've two columns in your table like
table name is myTable and two columns are
myId integer
myText text datatype
[code]
String sql = "INSERT INTO MYTABLE VALUES(?,?)";
String text = "some text";
PreparedStatement st = connection.prepareStatement(sql);
st.setInt(1, 12345);
st.setObject(2,text);
st.executeUpdate();
[code]
Hope it solves your problem.
Regards,
Rakesh
|

June 5th, 2007, 02:30 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
thanks for reply. But i need to read .doc file & insert it into database. I m trying with BLOB & CLOB. Yet not completed.
bye!
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |