File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Servlet and JDBC. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Servlet and JDBC. " Watch "Servlet and JDBC. " New topic
Author

Servlet and JDBC.

Paresh Nayak
Greenhorn

Joined: Nov 27, 2011
Posts: 7
I am having problem inserting records into the database.
I have a html page that contains a form asking user to enter a movie name and id.
once the submit button is clicked the details has to updated in a table through servlets.
i'm using oracle database

here is my code

movie.html

<HTML>
<HEAD>
<TITLE> Movie Database </TITLE>
</HEAD>

<BODY bgcolor="#CCCCFF">
<FORM METHOD=POST ACTION="add">

<TABLE>
<TR>
<TD>Movie Name : </TD>
<TD><INPUT TYPE="text" NAME="name"></TD>
</TR>
<TR>
<TD>Movie ID : </TD>
<TD><INPUT TYPE="text" NAME="id"></TD>
</TR>
<TABLE>
<TR>
<TD><INPUT TYPE="submit" value="Enter" ></TD>
</TR>
</TABLE>
</TABLE>

</FORM>

</BODY>
</HTML>



MovieEntry.java

code

web.xml


Paresh Nayak
Greenhorn

Joined: Nov 27, 2011
Posts: 7
Problem is the details are not getting updated in the database. I think its a driver problem. Can anyone tell me how to add the jdbc driver for oracle in the project.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

Paresh Nayak wrote:Problem is the details are not getting updated in the database. I think its a driver problem. Can anyone tell me how to add the jdbc driver for oracle in the project.


Just place the driver on the classpath! Are you getting any exceptions?


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

Database drivers usually go in the global Tomcat lib folder.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Paresh Nayak
Greenhorn

Joined: Nov 27, 2011
Posts: 7
Thanks.
The program finally worked.
For some reason the ODBC driver was not working.
Used ojdbc6_g driver.
it worked like charm.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet and JDBC.