Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet and database

 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i make my servlet access a database and print/store a table from it. Can you suggest any websites/books with a simple example that does this and nothing else ?

 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You need to learn JDBC and establish a JDBC connection from a servlet(in its simplest form or else use separate Data Access layer to do this).
Using this java.sql.Connection, you can interact with Database from DDL and DML queries.

Another option is to use some framework like iBatis to access the Database. That might be the next step once you are done working with plain JDBC Connection.

Regds,
amit
 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amit punekar wrote:Hi,
You need to learn JDBC and establish a JDBC connection from a servlet(in its simplest form or else use separate Data Access layer to do this).
Using this java.sql.Connection, you can interact with Database from DDL and DML queries.


Any website/book where i can get some simple examples for that ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at our FAQs, there are a bunch of resources in there. You should also have a look at the JDBC tutorial.
 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:Have a look at our FAQs, there are a bunch of resources in there. You should also have a look at the JDBC tutorial.

ok, reading...will get back here later...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic