Skip to content

Commit 5f0e6e6

Browse files
author
Nirmala Sundarappa
committed
Merge branch 'wls_servlet' of https://github.com/oracle/oracle-db-examples into wls_servlet
2 parents 2c99c9a + 71597e1 commit 5f0e6e6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

java/jdbc/Tomcat_Servlet/Readme.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
# Tomcat Java Servlet
2-
The Oracle JDBC drivers allow Java applications to connect and process data in the Oracle Database. Apache Tomcat is the application server for building and deploying Java EE applications. This repository contains a simple Java servlet along with the build scripts and instructions. The Java servlet that connects to the Oracle Database and performs some database operations. The
2+
The Oracle JDBC drivers allow Java applications to connect and process data in the Oracle Database. **Apache Tomcat** is the application server for building and deploying Java EE applications. This repository has code samples for a Java Servlet that connects to the Oracle Database using the Oracle JDBC driver. We have furnished `build.xml` to compile the servlet and the `Readme.md` that has instructions to compile and deploy this servlet on Tomcat. If you have subscribed to any Oracle Database Service on Cloud such as DBCS, EECS, BMCS etc., follow these instructions to verify the database connectivity with Tomcat.
33

44
# What you need to install?
55

6-
* **Apache Tomcat**: Download and install the [Apache Tomcat v](http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html)
6+
* **Apache Tomcat**: Download and install [Apache Tomcat](https://tomcat.apache.org/)
77
* **Apache Ant**: Make sure you have [Apache ANT](http://ant.apache.org/) to compile the source code
88
* **JDBC driver**: Download the latest JDBC driver [ojdbc8.jar from OTN](http://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html)
9+
* **Oracle Database**: You need to have a working Oracle Database with the credentials to verify the successful connection. Make sure either you have subscribed to Oracle Database Service on Cloud (DBCS, EECS, BMCS, ExaCS) or installed an Oracle Database on premise.
910

1011
# Steps to compile the Java Servlet
1112

1213
* **Update build.xml**: Download the `build.xml` present in this repository. Update TOMCAT_HOME to point to the location where Tomcat is installed.
13-
* **Create a Resource in context.xml**: Create an Oracle Datasource through the admin console. Let us name this datasource as `orcljdbc_ds`
14-
* **Update JDBCSample_Servlet**: Download the `JDBCSample_Servlet` from this repository and make sure you are using the correct name of the Oracle datasource created through admin console. i.e., `orcljdbc_ds` in the method `getDataSource()`
14+
* **Create a Resource in context.xml**: Download the `context.xml` present in `META-INF` folder. Update the database URL, username, and password to point to your Oracle Database. Let us name this datasource as `orcljdbc_ds`
15+
* **Update JDBCSample_Servlet**: Download the `JDBCSample_Servlet` from this repository. Update the method `getDataSource()` to use the correct Oracle datasource name. E.g.,`orcljdbc_ds`
16+
* **JDBC driver**: Place the downloaded JDBC driver ojdbc8.jar in `WEB-INF/lib` folder.
1517
* **Create the war file**: Go to the location where the `build.xml` is located. Execute the command `ant` that will compile and also create the `JDBCSample.war` file in the `dist` folder.
1618

1719
# Steps to deploy and run the Java Servlet
1820

1921
* **Deploy the WAR file**: Copy the `JDBCSample.war` file to TOMCAT_HOME/webapps/ and Start the Tomcat Server
2022
* **Invoke the Servlet**: Invoke the servlet at `https://localhost:8080/JDBCSample/JDBCSample_Servlet`
2123
* **Check the Results**: Check the results on the page and make sure that it prints driver information retrieved from the Oracle database.
24+
25+
26+
# Other Resources
27+
28+
* [Connecting Java Applications to Database Cloud Services](https://blogs.oracle.com/dev2dev/connecting-java-applications-to-database-cloud-services)
29+
* [Using Java Containers with Exadata Express Cloud Service (EECS)](http://www.oracle.com/technetwork/database/application-development/jdbc/jdbc-eecontainers-cloud.html#tomcat)

java/jdbc/WebLogicServer_Servlet/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Oracle JDBC drivers allow Java applications to connect and process data in t
1212

1313
* **Update build.xml**: Download the `build.xml` present in this repository. Update WLS_HOME to point to the location where WebLogic Server is installed.
1414
* **Create a Datasource in WebLogicServer**: Create an Oracle Datasource through the admin console. Refer to the blog for more details ["Create and Deploy a Java Servlet using WebLogic Server"](https://blogs.oracle.com/dev2dev/create-and-deploy-a-java-servlet-using-weblogic-server-wls). Let us name this datasource as `orcljdbc_ds`
15-
* **Update JDBCSample_Servlet**: Download the `JDBCSample_Servlet` from this repository and make sure you are using the correct name of the Oracle datasource created through admin console. i.e., `orcljdbc_ds` in the method `getDataSource()`
15+
* **Update JDBCSample_Servlet**: Download the `JDBCSample_Servlet` from this repository and Update the method `getDataSource()` to use the correct Oracle datasource name. E.g.,`orcljdbc_ds` created through admin console.
1616
* **Create the war file**: Go to the location where the `build.xml` is located. Execute the command `ant` that will compile and also create the `JDBCSample.war` file in the `dist` folder.
1717

1818
# Steps to deploy and run the Java Servlet

0 commit comments

Comments
 (0)