aspose file tools*
The moose likes JDBC and the fly likes connectivity in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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..
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 ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 56
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..


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

Joined: May 14, 2008
Posts: 5843
    
    7

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connectivity in jsp