Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners 2709-how-to-store how to store/retrieve doc file
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ramya
how to store/retrieve doc file
1 Answer(s)      6 years and 4 months ago
Posted in : Java Beginners



Advertisement
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
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
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... void main(String[] args) { File file = null; WordExtractor extractor = null
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
Convesion of txt file to doc file.??????
Convesion of txt file to doc file.??????  how to convert text file to doc file using java
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
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
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> <
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
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 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
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
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
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
doc to pdf convertion - Java Beginners
doc to pdf convertion  hi , I need to convert a .doc file that contains tables,pictures and text to pdf using Itext. I tried but it convert only texts. code i tried is package de.vogella.pdf.write; import java.io.
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 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
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
 

 

 

DMCA.com