Using JDBC in JSP to access SQL Server 2008 Database Sample _JSP programming

Source: Internet
Author: User
Tags stmt

Direct access to database by JDBC driver
Advantages: 100% Java, Fast and Cross-platform
Disadvantage: Access to different databases requires the download of a dedicated JDBC driver

(1) Download the corresponding database version of the JDBC driver and installation, attention to the installation of the resulting three file Msbase.jar,mssqlserver.jar,msutil.jar, copy it to the JSP project under the Web-inf/lib, Also copied to the Tomcat installation directory under LIB, no specific tests should be related to the configuration file.

(2) Data source, do not need

(3) configuration file, do not need

(4) Write JSP file test

<%@ page contenttype= "text/html; charset=gb2312 "language=" java import= "java.sql.*,java.io.*"%>  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.