Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet and JDBC.

 
Paresh Nayak
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Rob Spoor
Sheriff
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Database drivers usually go in the global Tomcat lib folder.
 
Paresh Nayak
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
The program finally worked.
For some reason the ODBC driver was not working.
Used ojdbc6_g driver.
it worked like charm.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic