Requirement:
To develop an application using Java and Oracle pc should have the configuration to support
java,Oracle Database, Apache-Tomcat Web Server , sufficient Space to store script.
Installation:
For developing java and Oracle based application, i proceeded in the following way:
1. installed "jdk-1_5_0_08-windows-i586-p" in C: / Program Files
2.installed oracle 9i.
3. Installed "jakarta-tomcat-5.5.7”, just unzipped it in D: \java2 folder like “D:\java-2\jakarta-
tomcat-5.5.7”
Java configuration:
I set up the following environment variables as user variable
1. “CATALINA_HOME “---- “D:\java-2\jakarta-tomcat-5.5.7”
2. “JAVA_HOME “----- “C:\Program Files\Java\jdk1.5.0_08”
3. “PATH “---- “C:\Program Files\Java\jdk1.5.0_08 \bin”
4. “CLASSPATH “---- “D:\java-2\jakarta-tomcat-5.5.7\common\lib\servlet-api.jar”
DSN configuration:
1. To get connection with oracle first I had to create a user that has a name “aditi” password “aditi” in oracle 9i.
The command is
create user aditi identified by aditi;
grant connect,resource to aditi;
2. Went to the System DSN and and click add button in the right side.
3. Selected “Oracle in orahome90”
4. Set “myora” as Data Source Name and “dns for oracle” in Description.
5.Pressed test connection at the right side of this page and set “aditi” in the service name and “aditi” in the password. Press ok.
6.It will give a confirmation massage like “connection successful”.
Now the DSN setting is finished.
Starting running my project:
Before I started the project at first I needed to run Oracle database server then “Apache-Tomcat" To start apache-tomcat I went to “D:\java-2\jakarta-tomcat-5.5.7\bin” then started the “startup.bat” file. After running the servers, went to “C:\apache-tomcat-5.5.15\webapps\” this folder, and created a new folder give a name to this folder like “OurEx” copied my project files in this folder.
Now I started my project
To start I opened my browser and in address bar write this
http://localhost:8081/OurEx/main and pressed enter after a few second it shows a login page.
The code for the login page is resides in main.java file. so when i ran the main.java from localhost, it shows the login page to me.
if I type my user name and password, it checks the username and password against the username and password stored in the oracle database, if matched it allows me to enter into the appliaction, other wise shows me a message that "wrong username or password"
For the port number 8080, a user may face problem, so he can change the port from 8080 to 8081.
This thing can be done as follows:
Go to this folder “D:\java-2\jakarta-tomcat-5.5.7\conf” then open “server.xml” file there find this
[ Connector port="8080" maxHttpHeaderSize="8192" ………..]
Change it to this
[Connector port="8081" maxHttpHeaderSize="8192" ………..]
Save and close the file then restart web server .
the port number that is used either in 8081 or 8080 or something other than this, should also be used in the code where ever port number is used. Unless application will not work correctly.
After this I hope there isn’t any problem that may be faced.
No comments:
Post a Comment