This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Servlet and JDBC.

 
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.
 
Ranch Hand
Posts: 607
Firefox Browser Spring Java
  • 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?
 
Sheriff
Posts: 21804
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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.
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!