Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 5th, 2006, 11:44 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to store text file in database

I simply want to browse a text file and wants to store
it in database(mysql).would you tell me please how to do this.

__________________
regards ,Vivek
  #2 (permalink)  
Old February 13th, 2006, 05:29 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should look at using MySQL's LONGBLOB or LONGTEXT data type. They can store up to 4 gigabytes of binary or textual data, respectively. You can use the regular MySQL JDBC connector methods for storing and retrieving LONGBLOB and LONGTEXT types.

However, storing this kind of data in the database is inefficient. You should seriously consider storing the text file on the file system instead. You can put it in the /WEB-INF/ folder to prevent direct access to it by HTTP requests.

Jon Emerson
http://www.jonemerson.net/


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read file and store it to database sparsh2010 Access VBA 3 July 17th, 2008 08:27 AM
store a single line of text from a file....how???? danielnixon General .NET 2 May 1st, 2008 12:09 PM
How to store MS Word File in database kesar SQL Language 2 March 1st, 2007 06:34 AM
how to store a text file vivekkumar_23 SQL Server 2000 2 July 4th, 2006 09:18 AM
how to store file in sql server 2000 database vivekkumar_23 SQL Server 2000 1 February 27th, 2006 10:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.