User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 374,018 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,696 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 19394 | Replies: 1
Reply
Join Date: Feb 2005
Posts: 11
Reputation: nelly_1005 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nelly_1005 nelly_1005 is offline Offline
Newbie Poster

Help JSP connection to database

  #1  
Apr 29th, 2005
hi guys

hope you can help

well im tryin to connect my jsp to my database, im uisng tomcat 5 and have stored the MS access database in my ROOT folder.

i have created a User DNS, and have sdk 1.4.2_08 installed

Problem is im not sure what to do now??

do i have to install a sun driver? if so how?

and finally how do i connect to teh database?

Please help thanks! x
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2004
Posts: 8
Reputation: adityabakle is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
adityabakle adityabakle is offline Offline
Newbie Poster

Solution Re: JSP connection to database

  #2  
May 1st, 2005
Hi nelly

No need to do much
I hope u are aware of JDBC-ODBC Driver and they are supported by sdk1.4

First create a DSN using ODBC in control pannel
later for JSP to connect to Database

use the following code

<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:<DSN name>")
%

provide DSN name after the second colon.
In this way you are connected to your data base and you can futher query your database using statement object .

For futher help
mail adityabakle@gmail.com
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JSP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 11:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC