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

connectivity in jsp  RSS feed

 
Greenhorn
Posts: 1
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Author and ninkuma
Marshal
Posts: 66352
155
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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)
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!