how to store/retrieve doc file

how to store/retrieve doc file

View Answers

September 16, 2008 at 6:05 PM

Use this stuff inside your jsp page for store file inside database, for follwing same concept for retrive data

<%@page import="java.sql.Connection"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.io.File"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="java.sql.PreparedStatement"%>
<%try{
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/quoting";, "root", "");
File file = new File("C://skill.txt";);
FileInputStream fin = new FileInputStream(file);
PreparedStatement pre = conn.prepareStatement("insert into MyTable values(?)");
pre.setBinaryStream(1,fin,(int)file.length());
pre.executeUpdate();
System.out.println("Inserting Successfully!");
pre.close();
conn.close();
}
catch (Exception e){
System.out.println(e.getMessage());
}
%>

Thanks
Rajanikant









Related Tutorials/Questions & Answers:
how to store/retrieve doc file - Java Beginners
how to store/retrieve doc file  i want to wirte a code that stores/ retrieves .doc files to the mysql database using jsp pages... can anyone help me with the code?  Use this stuff inside your jsp page for store file
how to store,retrieve,modify the data
how to store,retrieve,modify the data  hello sir ,how to store,retrieve,modify the data using the swing please help me
Advertisements
How to store and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one of my application I have to store and then display the image in JSP. How to store and retrieve image from database in JSP? Thanks   HI, You can use
how to store and retrieve image from database
how to store and retrieve image from database  how to store and retrieve images into database(oracle) and how to retrive images from database using jsp   Here is a jsp code that insert and retrieve image from mysql
how to store and retrieve image using struts2 and hibernate integration
how to store and retrieve image using struts2 and hibernate integration  how to store and retrieve image using struts2 and hibernate integration? plz help !! thanks in advance
how to store and retrieve images int and from the database using php
how to store and retrieve images int and from the database using php  please anyone can help me in storing the images and retrieve it back from the Mysql database using php
store and retrieve data
store and retrieve data  sir,i want to store the entering data in a word file and retrieve it when i need.i am try to develop a video portal.in which user can watch video and write comments.the comments are stored in a file
How to read the .doc/ .docx file in Java Program
How to read the .doc/ .docx file in Java Program  Hi, I am beginner in Java programming language. Can anybody explain How to read .doc file in Java.... This way you can read the .doc or .docx file in Java programming language. Thanks
How to read a line from a doc file
How to read a line from a doc file  How to read a line from a doc file   Hi Friend, To run the following code, you need to download POI... { public static void main(String[] args) { File file = null; WordExtractor
Convesion of txt file to doc file.??????
Convesion of txt file to doc file.??????  how to convert text file to doc file using java
how read data from doc file in same formate in jsp
how read data from doc file in same formate in jsp  how we can read and display data on jsp page, from doc file with the same formatting
how to convert doc file into html using java swing
how to convert doc file into html using java swing  i want to convert doc file into html and display it on jtextarea please help me and give the sample code
Write data in doc file
Write data in doc file  How to write data or string in word file
read doc and docx file in javascript
read doc and docx file in javascript  How i read doc and docx file in javascript
doc file - Java Beginners
doc file   i want to read .doc file ?....it is a part of my project plz help. if possible , can anyone give me the code
Reading .doc file using swing
Reading .doc file using swing  Sir, Could U Please Tell me the Way To Read .doc file in java using swing,with code
convert a file .doc to .zip
convert a file .doc to .zip  hiii, I uploaded a file with extension .doc now i required with .zip   Hi Friend, Try the following code...;TITLE>Display file upload form to the user</TITLE></HEAD> <
serch document from .doc and .docx file
serch document from .doc and .docx file  how to find particular word from .doc and .docx file and that date insert into a data base
openning the pdf or doc file in same jsp
openning the pdf or doc file in same jsp   **how to open the pdf and doc file in same jsp after clicking the link or button (which is with out moving to the next page). will some body help me on this @simple format please
Merge multiple jasper file to one word Doc using java
Merge multiple jasper file to one word Doc using java   how to Merge multiple jasper file to one word Doc using java
Open a .doc file by click on the link using struts - Struts
Open a .doc file by click on the link using struts   I want to open a doc extension file when i click a link on jsp page .I know only about which is write in web.xml but not exactly know how i do this.Plz any one can help me
About search and replace contains of .doc or .docx file using java.
About search and replace contains of .doc or .docx file using java.  Hi , I am trying to replace contents of ms.word document in .doc or .docx... [CutomerName] Address [Cs_add] This is my template file. I want
How to install gtk-doc-tools package in Ubuntu?
How to install gtk-doc-tools package in Ubuntu?  How to install gtk-doc-tools package in Ubuntu? Thanks   In this post I will explain you how to install this package on Ubuntu? To install gtk-doc-tools package
writing document (.doc) file from java with format such as font type, font style
writing document (.doc) file from java with format such as font type, font style  Can anyone help me how can i write a java code to write a string... FileInputStream(file)); HWPFDocument doc = new HWPFDocument(fs); Range range
sending doc files - Swing AWT
sending doc files  how to send doc file using java from one machine to other over a network
how to create xml schema from xml doc using java
how to create xml schema from xml doc using java  i want to create xml schema from xml document programatically using java... am using Netbeans IDE... need to create the xml schema for that document and send both xml doc ans schema
Java Read .doc file using POI library
Java Read .doc file using POI library In this section, you will learn how to read the word document file using POI library. The class HWPFDocument throw all of the Word file data and the class WordExtractor extract the text from
net.anotheria - ano-doc-parent version 2.5.4 Maven dependency. How to use ano-doc-parent version 2.5.4 in pom.xml?
net.anotheria  - Version 2.5.4 of ano-doc-parent Maven dependency? How to use  net.anotheria  - Version 2.5.4 of ano-doc-parent in pom.xml? How to use ano-doc-parent version 2.5.4 in pom.xml? Learn to use this dependency
javadb - javadb-doc version 10.10.2.0 Maven dependency. How to use javadb-doc version 10.10.2.0 in pom.xml?
javadb  - Version 10.10.2.0 of javadb-doc Maven dependency? How to use  javadb  - Version 10.10.2.0 of javadb-doc in pom.xml? How to use...; dependency? How to use  javadb - javadb-doc version 10.10.2.0 in project? Steps
taglibs - session-doc version 1.0.1 Maven dependency. How to use session-doc version 1.0.1 in pom.xml?
taglibs  - Version 1.0.1 of session-doc Maven dependency? How to use  taglibs  - Version 1.0.1 of session-doc in pom.xml? How to use session... 3: Save pom.xml file - Now you are ready to use the  taglibs - session-doc
jakarta.enterprise - jakarta.enterprise.cdi-spec-doc version 4.0.0 Maven dependency. How to use jakarta.enterprise.cdi-spec-doc version 4.0.0 in pom.xml?
of jakarta.enterprise.cdi-spec-doc in pom.xml? How to use jakarta.enterprise.cdi-spec... - jakarta.enterprise.cdi-spec-doc version 4.0.0 in your pom.xml file you can run...jakarta.enterprise  - Version 4.0.0 of jakarta.enterprise.cdi-spec-doc
taglibs - application-doc version 1.0.1 Maven dependency. How to use application-doc version 1.0.1 in pom.xml?
taglibs  - Version 1.0.1 of application-doc Maven dependency? How to use  taglibs  - Version 1.0.1 of application-doc in pom.xml? How to use...-doc in project by the help of adding the dependency in the pom.xml file
taglibs - standard-doc version 1.0.6 Maven dependency. How to use standard-doc version 1.0.6 in pom.xml?
taglibs  - Version 1.0.6 of standard-doc Maven dependency? How to use  taglibs  - Version 1.0.6 of standard-doc in pom.xml? How to use...? How to use  taglibs - standard-doc version 1.0.6 in project? Steps
net.anotheria - ano-doc version 2.6.3 Maven dependency. How to use ano-doc version 2.6.3 in pom.xml?
net.anotheria  - Version 2.6.3 of ano-doc Maven dependency? How to use  net.anotheria  - Version 2.6.3 of ano-doc in pom.xml? How to use ano...? How to use  net.anotheria - ano-doc version 2.6.3 in project? Steps
net.anotheria - ano-doc version 2.6.3 Maven dependency. How to use ano-doc version 2.6.3 in pom.xml?
net.anotheria  - Version 2.6.3 of ano-doc Maven dependency? How to use  net.anotheria  - Version 2.6.3 of ano-doc in pom.xml? How to use ano...? How to use  net.anotheria - ano-doc version 2.6.3 in project? Steps
How to create XML file - XML
How to create XML file  Creating a XML file, need an example. Thanks!!  To create XML file you need plain text editor like note pad. After creating your file save it with .xml extension.  Hi,Java programming
ModuleNotFoundError: No module named 'doc'
ModuleNotFoundError: No module named 'doc'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'doc' How to remove the ModuleNotFoundError: No module named 'doc' error
I have one small doubt , does this code read Microsoft Office suit file format data such as .doc , .docx etc ?
I have one small doubt , does this code read Microsoft Office suit file format data such as .doc , .docx etc ?  import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class ReadFileExample
How to create one xml file from existing xml file's body?
How to create one xml file from existing xml file's body?  Hi, i'm working with content optimization system.I want to know how we can take all data from an xml doc's body to develope another xml with that content.I'm using JDOm
How to write in File in Java
How to write in File in Java  Hi, How to write in File in Java. Please suggest and give example of this program. thanks
How to rename a file in Java?
How to rename a file in Java?  Hi, What is the code for renaming a file? How to rename a file in Java? Thanks   Hi, You can use the renameTo() method for renaming a file or directory. Check tutorial at Rename
how to add a file in GZIP
how to add a file in GZIP  Hi, how to add a file in GZIP using Java.   Hi, I have found a good referral site for How to Add a file in GZIP file format using Java. http://www.roseindia.net/java/examples/io
how to download file
how to download file  How do I let people download a file from my page
How to prepare XML file?
How to prepare XML file?  Hi, I want to prepare XML File, can you tell me how should I do it? Thanks.   Hello, Following links can help you create an XML file.. Create XML File using Servlet How to generate
How to compress a file in Java?
How to compress a file in Java?  How to compress a file in Java through Java code? I want a good example in Java. Thanks   Hi, Check the tutorial Compressing the file into GZIP format. Thanks
How to write in File in Java
How to write in File in Java  Hi, How to write in File in Java... bufferedWriter object to write in the file. For more details and examples related to How..., For writing some data in the file we require some class file, objects
how to create ipa file
how to create ipa file  Hi, How to .ipa file? Thanks   Hi, Please check the thread Resources have been modified iPhone. Thanks
How to Write to file in Java?
How to Write to file in Java?  How to Write to file in Java Program... the Examples of How to write to File in Java Program: WriteToFileExample.java import... how to write in a file."); br.close(); } catch (Exception e) { System.err.println
how to convert .xml file to csv file
how to convert .xml file to csv file  how to convert .xml file to csv file
how to update the text file?
how to update the text file?  if my text file contains a string and integer in each line say,: aaa 200 bbb 500 ccc 400 i need a java code to update the integer value if my input String matches with the string in file. please

Ads