Build the JSP environment for Windows

Source: Internet
Author: User
Tags sql server driver mssqlserver sql variables stmt version variable window
Js|window in the company have nothing to do, like doing dongdong. This time to see the JSP environment under windows! operation is as follows!

Adaptive system: Windows PRO/SERVER/AD Server

Required Software: J2sdk-1_4_1_02-windows-i586.exe

Jakarta-tomcat-4.0-b3.zip

To begin the installation:

I. Installation J2sdk-1_4_1_02-windows-i586.exe in C:\, directory named j2sdk1.4.1_02

Two. Extract jakarta-tomcat-4.0-b3.zip in C:\, directory named Jakarta-tomcat

Three. Set System variables

/My Computer/Properties-> Advanced-> System variables

New variable name CLASSPATH variable value C:\j2sdk1.4.1_02\lib\tools.jar;c:\jakarta-tomcat\common\lib\servlet.jar

New variable name java_home variable value c:\j2sdk1.4.1_02

New variable name PATH variable value c:\j2sdk1.4.1_02\bin

Ok!

Simple, to this a default installation, with the support of JSP environment is built!

Then, to run the Startup.bat in C:\jakarta-tomcat\bin.

Enter in IE http://127.0.0.1:8080or http://native ip:8080 or http://localhost:8080

can be accessed to a page with a kitten.

If some friends want to start on the Jakarta-tomcat, then only need to put the Startup.bat/start/->/program/->/start/In!

Now have JSP environment of course also need database support, Windows we use is SQL.

I built the SQL data source for a System DSN directly, all by default (when you choose the validation mode, and then you choose the database, everything is by default, test it.)

Then my JSP site database is good, note oh, I install SQL is SA and system dual authentication! That is, mixed mode!

The following information is for other reference only, I Ken didn't use it

-----------------------------------------------------------------------------------------------------

Full installation and test instructions for SQL Server-jdbc-driven

This is I in Changsha, the ear of the Software Education Center to do a graduation project to organize a document, recently some of the younger brother asked me, the rummage is finally put it to hug out. The database inside is the database of the project that we do at that time, you can revise according to your own database, of course other data also need to make corresponding modification according to your own actual situation.

First, download the SQLSERVER2000 JDBC driver.

This driver is available at the Microsoft site:

Window operating System

Http://www.uncj.com/upload/files/ms_jdbc_setup.exe

Http://download.microsoft.com/download/3/0/f/3 ... a570-27366b2271d8/setup.exe


Unix Operating System Mssqlserver.tar

http://download.microsoft.com/download/3/0/f/30f ... -27366b2271d8/mssqlserver.tar


Ii. installation of JDBC

Execute the ms_jdbc_setup.exe executable file, all you need to do is click Next, until the Finish button appears, complete the installation.

Note:

(1) Ms_jdbc_setup default installation path is: c:\Program Files\Microsoft SQL Server Driver for JDBC

(2) This version (version 2.2.0022) only supports Microsoft SQL Server Driver for JDBC

(3) installation directory \lib\ three jar files that is the JDBC drive core we want

Msbase.jar

Mssqlserver.jar

Msutil.jar


Third, add the three jar files of the above (3) to the environment variable

Classpath

D:\webserver\lib\msbase.jar;d:\webserver\lib\mssqlserver.jar;d:\webserver\lib\msutil.jar

Note: It is also convenient to copy the above three files to the Java_home\jre\lib\ext directory where your JVM machine resides, but it is not recommended.


Four, test

JSP file:

<%@ page contenttype= "text/html;charset=gb2312"%>

<%@ page import= "java.sql.*"%>


<body>

<%

Class.forName ("Com.microsoft.jdbc.sqlserver.SQLServerDriver"). newinstance ();

String url= "Jdbc:microsoft:sqlserver://localhost:1433;databasename=haiguan";

String user= "SA";

String password= "";

Connection conn= drivermanager.getconnection (Url,user,password);

Statement stmt=conn.createstatement (resultset.type_scroll_sensitive,resultset.concur_updatable);

String sql= "SELECT * from Xt_user";

ResultSet rs=stmt.executequery (SQL);

while (Rs.next ())

{

%>

Your first field content is: <%=rs.getstring (1)%>

The contents of your second field are: <%=rs.getstring (2)%>

<%

}

%>

<%out.print ("Successful database operation, congratulations");%>

<%

Rs.close ();

Stmt.close ();

Conn.close ();

%>

</body>



V. Matters of attention

1. Make sure your SQL service is up and running

2. Can use SA or other user to log on normally in SQL Manager (some people use NT user management mode when installing SQL, there may be some problems here)

3. Configure environment variables for the first time it's best to restart the computer

4. Note the startup order of the JVM and database: Start the database first, and then start the JVM machine.

Note: After stopping the Web server, reboot again, preferably in the middle of more than 10 seconds interval.

5. Note The network connectivity of the operating system

A. Started the TCP/IP service

B. Configure the relevant IP address, some people may use the machine is automatically assigned IP or have configured IP, but the network may not be able to find IP

6. Some machines in the debugging of the best can be (d) The connection address localhost to the database server IP, which is also to pay attention to the reason of 5

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.