1、Tomcat与Oracle安装配置方法Installation Instructions for:Tomcat 6.0 or 7.0Oracle 10g (Express Edition XE)Tomcat 7.0 Installation1. Download Apache Tomcat 7 and unzip it.2. Add the location of your JDK or JRE to the environment variable $JAVA_HOME or $JRE_HOME3. Add the location of your Tomcat to the environ
2、ment variable $CATALINA_HOME4. Add $CATALINA_HOME/bin to your environment variable $PATH5. Change every occurrence of port 8080 to 8088 in $CATALINA_HOME/conf/server.xml6. Edit $CATALINA_HOME/conf/tomcat-users.xml and add a manger:7. To start Tomcat open a command window and type startup8. To stop T
3、omcat open a command window and type shutdown9. To operate Tomcat go to Step 6 in the next section.Tomcat 6.0 Installation1. Download Apache Tomcat Installer and run it.2. Select Full installation option3.To avoid possible conflicts with Oracle choose Connector Port 8088; select any username and pas
4、sword you wish.4.To start Tomcat, go to All Programs Apache Tomcat 6.0 Configure Tomcat menu item and click Start5.To stop Tomcat, go to All Programs Apache Tomcat 6.0 Configure Tomcat menu item and click Stop6.To connect to the manager, go to All Programs Apache Tomcat 6.0 Tomcat Manager and enter
5、the username and password you selected in Step 37.You should then see the manager open up in your web browser (http:/localhost:8088/manager/html) as shown below. Make sure Message is OK.8.Unzip and copy the entire myJSP directory, which contains a number of JSP examples, to webapps directory under y
6、our Tomcat6.0 home directory. To deploy this directory, type /myJSP in Context Path as shown below and click the Deploy button.9.To test the JSP examples contained in the myJSP directory, type their exact address in your browsers URL box as shown below:10. Finally, to enable Tomcat to connect to Ora
7、cle copy the Oracle JDBC driver to the lib directory under your Tomcats home directory.Oracle 10g (Express Edition XE) Installation Download and install Oracle 10g for Windows XP. During installation you will be prompted to enter a password. That password along with the username system will allow yo
8、u to login to Oracle as the System Administrator to create user accounts. Once Oracle is installed, it will be running locally on your PC off port 8080 and you will be able to access it through Oracles Application Express (apex) interface.Creating Database User AccountsLogin as System Administrator
9、to create user accounts:Go to Administration - Database Users and select Create:Enter your choice of username and password and make sure all check boxes are checked (except for DBA):Now, logout and log back in as the new user to run SQL commands.Running SQL CommandsLogin as the database user created
10、 in the previous step:Select the SQL options:Select the SQL Commands options:Now enter SQL commands in the top panel and then click Run or Save or History:Populating Tables with DataAssume we have relation temp stored in the database as shown above. Data can be entered one row at a time using the in
11、sert into command:When working with large amounts of data that are stored in external files, you may import the external data by creating a tab-separated data file using a text editor such as Notepad or Textpad. Lets assume we have a tab-separated text file called temp.dat as shown below:Go to HomeU
12、tilitiesData Load/UnloadLoadLoad Text Data and select Existing Table and Upload File options as shown below. Then, click Next twice:Select Temp (table) and Next:Choose File temp.dat, type t (tab) in the Separator box and uncheck the check box. Then, click Next:Select appropriate Column Names and not
13、ice the read rows of data at the bottom of the Column Mapping section:The result screen should show 2 (rows of data) for Succeeded 0 for Failed. A non-zero value for Failed will mean that you have skipped some of the steps above or your input file is not in the correct format:To verify the data load
14、, go to HomeSQLSQL Commands and examine the contents of temp:Creating and Running SQL ScriptsGo to Home - SQL and choose the SQL Scripts options:You may create scripts internally through Oracles Script Editor or externally through Notepad or another text editor. Create a SQL script file called query
15、1.sql:create table chefs(CHEF_ID int not null,NAME varchar2(20),SPECIALTY varchar2(20),SALARY number(10),primary key(CHEF_ID);Upload the script and give it a name:If all goes well, the script will appear as an icon on the bottom panel:Change the View option to Details and click Go and you should see
16、 the following screen appear. Now click Run:Confirm your request by clicking Run again and then View Results:After viewing the results, go back to Home - SQL - SQL Commands to examine the catalog and make sure the changes have taken place:Running SQL Command Line Utility In addition to using Oracles
17、 graphical user interface, you may use the Run SQL Command Line utility to run SQL commands or load/execute SQL scripts. On your desktop click: Start Oracle 10g Express Edition Run SQL Command Line When the SQL prompt appears, log in as the DB user. For example, if you have set up a user bforoura wi
18、th password bforoura, enter: SQL connect bforoura Enter password: bforoura When you are logged in, you may type in SQL commands or load SQL scripts (see my Oracle lecture notes) To create an output of your session, use the spool command SQL spool c:tempoutput.txt - save the output file in the requir
19、ed location SQL type in all your commands here SQL SQL spool off - now all your session transactions are saved in this fileConnecting to Oracle 10g via Tomcat 6.01. Log into Oracle as a regular user and create the employees relation and fill it with data as shown here.2. Start Tomcat and go to http:/localhost:8088/myJSP/ex5.html. Type in the username and password of the Oracle user you previously created.3. You should see the table data appear on the web page as shown below:4. WERE DONE!
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2