Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 1st, 2007, 11:04 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

  #2 (permalink)  
Old June 4th, 2007, 05:58 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
  #3 (permalink)  
Old June 5th, 2007, 01:30 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!

  #4 (permalink)  
Old June 5th, 2007, 07:25 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi,

Quote:
quote:Originally posted by sharvari_mothe
 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!
Have a look at the following links, might be helpful to you

http://www.samspublishing.com/articl...p?p=26251&rl=1
http://publib.boulder.ibm.com/infoce...c/rjvjdata.htm
http://www.datadirect.com/developer/...sics/index.ssp

Regards,
Rakesh
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert Data from Excel file to SQL server yes_no ASP.NET 1.0 and 1.1 Professional 5 August 27th, 2008 12:46 AM
Save a text file on SQL Server petercyriljones SQL Server DTS 2 January 3rd, 2007 06:35 AM
Bulk Insert to Sql Server from .txt file avats BOOK: Beginning VB.NET Databases 1 June 3rd, 2005 04:44 AM
Upload a Text file from a Web Client to SQL Server petercyriljones Classic ASP Professional 0 May 20th, 2005 10:26 AM
SQL 2000 database / text file / binary file pallone Javascript How-To 3 January 28th, 2005 12:26 PM



All times are GMT -4. The time now is 03:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.