aspose file tools
The moose likes JDBC and the fly likes connectivity in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JDBC
Reply Bookmark "connectivity in jsp" Watch "connectivity in jsp" New topic
Author

connectivity in jsp

kashyap upadhyay
Greenhorn

Joined: Mar 04, 2010
Posts: 1

hi guys!!
i am new in the java
i had facing one problem
can you teach me a connectivity in database using java server pages technology
thanks :
can you give me connectivity code?
please..reply..

This message was edited 1 time. Last update was at by kashyap upadhyay

Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55

What is your Database, you have to use the JDBC driver for thr database you are using. Here is the code snippet for JDBC connection for MYSQL database,




Go google my friend
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48844

Database access should have nothing to do with JSP and vice versa. DB access should occur in the Model layer of a properly structured MVC application.

Moved to the JDBC forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Shinelin Samuel wrote:
What is your Database, you have to use the JDBC driver for thr database you are using. Here is the code snippet for JDBC connection for MYSQL database,




Go google my friend



... though if you are using a Servlet container (as you must be if you are using JSPs) you might prefer using a DataSource. (Not sure what that is? Have a read through this)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
him jain
Ranch Hand

Joined: Feb 05, 2010
Posts: 55
I am using windows and running Tomcat 6.0.24.
Is there any need to add any db etc in odbc?
I am trying to connect a servlet to database.
Please anyone tell me the configuration to be done..

This message was edited 1 time. Last update was at by him jain



--Himanshu Jain
http://jainhim.blogspot.com/
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4489

Him, what database? You do not need to set up anything in ODBC. You should get the JDBC driver for your database and use that.


JBoss In Action
 
 
subject: connectivity in jsp
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com