JDK1.4 + Tomcat5.0 + SQL Server2000 Detailed Configuration Solution

xiaoxiao2021-03-06  63

JDK1.4 Tomcat5.0 SQL Server2000 Detailed Configuration Solution

Download the above three software and install the JDK1.4 installation directory: D: /jdk14tomcat5.0 installation directory: D: / Tomcat5sql server2000 installation directory default /// First, set environment variables ClassPath D: / JDK14 / lib / Tools. JAR; D: /JDK14/LIB/dt.jar; D: / Tomcat5 / bin; D: / Program Files / Microsoft SQL Server 2000 Driver for JDBC / LIB / MSBASE.JAR; D: / Program Files / Microsoft SQL Server 2000 Driver for JDBC / lib / mssqlserver.jar; D: / Program Files / Microsoft SQL Server 2000 Driver f or JDBC / lib / msutil.jar Java_home D: / jdk14 Tomcat_home D: / tomcat5 Path D: / Program Files / Microsoft SQL Server / 80 / Tools / Binn; D: / JDK14 // Second, Tomcat5 setting Website Virtual Path Open: [System Pan:] / Tomcat5 / Conf / Server.xml Process 1: method 2: (for convenient debugging recommended this method, website port is set to 80 If you want to keep Tomcat5 help information page, please use the first method): / 3, port setting Tomcat5 website port default 8080

If you are installed, it will start each time you follow the system, you can set it to manual! "Control Panel" -> "Management Tool" ----> "Component Service" -----> Select the "Service (Local)" -----> Open the right "World Wide Web Publishing" Properties -----> "General" -----> Service Status: Click "Debet" -----> In Startup Type: Select "Manual" -> "OK" 4, modify enable Default web page: Open with Notepad: [System Pan:] / Tomcat5 / Conf / Server.xml Index.jsp Here, you can add the default web page document to debugging, it is recommended to comment out or delete the default web page: index.jsp -> When opening the website, the current file will All files under the clamp are displayed in the list. You can test the corresponding page.

/ 5. Start Tomcat5 Open: [System Danger:] / Tomcat5 / Bin / Startup.bat Off: [System Pan:] / Tomcat5 / Bin / Shutdown.bat / 6, Test Website: Setup Method 1: In the address bar input (port 80): http: // localhost / input (port 8080): http: // localhost : 8080 / Sets Virtual Directory Method 2: In the address bar input (port 80): http: // localhost / englishstars / In the address bar input (port 8080): http: // localhost: 8080 / Englishstars / seven, test with SQL Server2000 database connection code database name: Test table name: Userinfo field name: casual (this example 3 or more) < % @ Page ContentType = "Text / HTML; Charset = GB2312"%> <% @ page import = "java.sql. *"%> <% class.Forname ("com.microsoft.jdbc. SQLSERVER.SQLSERVERDRIVER "). NewInstance (); string url =" JDBC: Microsoft: SQLServer: // localhost: 1433; // user, password "; user name and password for the database String user =" sa " String password = ""; connection conn = drivermanager.getConnection (URL, User, Password); STA tement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); String sql = "select * from userinfo"; ResultSet rs = stmt.executeQuery (sql); while (rs.next ()) {%> Your first A field content is: <% = rs.getstring (1)%>
Your second field content is: <% = rs.getstring (2)%>
Your third field content To: <% = rs.getstring (3)%>
<%}%>

转载请注明原文地址:https://www.9cbs.com/read-121464.html

New Post(0)