dis jsp code help u for uploading text into database
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<html>
<head>
<title></title>
</head>
<body>
<%
try
{
String name;
String address;
String path;
name=request.getParameter("name");
address=request.getParameter("address");
File image=new File(request.getParameter("image"));
path=request.getParameter("image");
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/sushikha","root","root");
PreparedStatement pstmt=con.prepareStatement("insert into pro(name,address,data,path) values(?,?,?,?)");
pstmt.setString(4,path);
pstmt.setString(1,name);
pstmt.setString(2,address);
InputStream is=new FileInputStream(image);
//FileReader is = new FileReader(image);
pstmt.setBinaryStream(3, is, (int)(image.length()));
int s=pstmt.executeUpdate();
if(s>0)
{
out.println("Uploaded");
}
else
{
%>
unsucessfull
<%}
is.close();
pstmt.close();
}
catch(Exception e)
{
}%>
</body>
</html>
neha..................