Configuration of the Jsp+tomcat+mssql system

Source: Internet
Author: User
Tags key mssql variable valid tomcat backup
Configuration of JS Jsp+tomcat+mssql system
Program Description:
Using the database for SQL Server, develop language java.
1 Creating a database:
1.1 Start SQL Server,
1.2 Run Enterprise Manager.
1.3 Create the Childrenbooks database,
1.4 Physical Database Name
1.5 said: Childrenbooks_data.mdf,
1.6 Database log: Childrenbooks_log.ldf; saved in the practice directory.
1.7 Creating a table: user_table (IDX primary key)
IDX int 4 non-null primary key
user_id Char 16
passwd_id Char 16
2 Backup Database:
2.1 Under the practice catalogue,
2.2 Copies of Childrenbooks_data.mdf and Childrenbooks_log.ldf,
2.3 Backup to destination folder;
3 Restoring the database:
3.1 Open the Query Analyzer for MSSQL,
3.2 Executing stored procedures
sp_attach_db ' childrenbooks ', ' D:\practise\childrenbooks_Data.MDF ', ' D:\practise\childrenbooks_Log.LDF '
3.3 After the successful execution of the command,
3.4 Refresh the list of databases.


4JKD Installation:
4.1 Configuration
Select My Computer on the desktop (right)-> advanced-> environment variable-> system variable-> new
Enter in the variable name: CLASSPATH,
4.2 The value of the variable entered:
C:\Sun\AppServer\jdk\lib\dt.jar; C:\Sun\AppServer\jdk\lib\tools.jar; C:\Sun\AppServer\jdk\bin
Configuration is over,
4.3 To restart the computer, the environment variable can be valid.
4.5 Test
Write a simple Java program:
public class HelloWorld {
public static void Main (String args[]) {
System.out.println ("Hello world!");
}
}
Note: This file name must be "Helloworld.java",
4.6 The case also differentiates.
4.7 Compilation:
Javac Helloworld.java
4.8 Run:
Java HelloWorld


5 Tomcat Installation:
5.1 Configuration
Select My Computer on the desktop (right)-> advanced-> environment variable-> system variable-> new
Enter in variable name: java_home
Input in variable value: C:\SUN\APPSERVER\JDK
Enter in variable name: tomcat_home
Input in variable value: C:\TOMCAT5
Configuration is over, the environment variable is valid after you restart the computer.
5.2 Test
Start Tomcat:
5.3 Browse
Enter in Browser: http://localhost:8080/
5.4 Run
There are JSP examples and Servlet examples on this page
5.5 Quit Tomcat


6JSP the physical address of the website:
6.1 Development of JSP page, put it into the table of contents C:\Tomcat5\webapps\ROOT
As a test under this folder,
6.2 New File Test.html (note case sensitive)
The contents of this file are: Hello I ' m test.
Run the Web page,
6.3 Start Tomcat,
6.4http://localhost:8080/test.html


7 using JDBC to connect to the database:
7.1 Configuring the JDBC Data source:
User ODBC
Add->sqlserver
Name: CHILDBOOKODBC
Machine name is native name
Use User ID and password
User name: sa password: SQL
Change the default database name to be: childrenbooks
Complete
7.2 Note that the SQLSERVERJDBC 3 packets are copied under the Tomcat/common/lib file, recommended under the latest Jdbcformssql





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.