Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2007, 01:39 AM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database connection with SQL Server

I want to connect jsp page with database in MS SQL Server. Can anyone plz help me out with this?

I am a new to JSP.

 
Old May 4th, 2007, 11:20 PM
Authorized User
 
Join Date: Aug 2005
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Default

first u've 2 create a DSN of ur database in ODBC
for example the DSN name is "mydb"
now in ur JSP page, import the java.sql.* package, and then...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:mydb");

 
Old May 28th, 2007, 02:19 AM
Authorized User
 
Join Date: May 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

find more at
http://find more@<br /> <br /> htt.../jdbc_api.html

http://studyjava.org/forums/
 
Old May 29th, 2007, 04:39 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

Quote:
quote:Originally posted by kanoorani
 first u've 2 create a DSN of ur database in ODBC
for example the DSN name is "mydb"
now in ur JSP page, import the java.sql.* package, and then...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:mydb");
You cann't use JDBC ODBC bridge at enterprise level.
Find information about how to connect to MS SQL Server using JDBC at the following URLs

http://www.akadia.com/services/sqlsrv_jdbc.html
http://www.java-tips.org/other-api-t...sing-jdbc.html
http://msdn2.microsoft.com/en-us/data/aa937724.aspx
http://support.microsoft.com/kb/313100

Regards,
Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server Connection and Database Problem workib C# 1 November 13th, 2008 03:26 PM
IIS server, connection to offsite database server Hazzardusa Classic ASP Databases 1 August 14th, 2005 10:03 PM
Server error for database connection frankv25 ASP.NET 1.0 and 1.1 Basics 5 August 14th, 2004 07:33 AM
Cannot add database connection in server explorer bbhill VS.NET 2002/2003 1 June 30th, 2003 09:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.