Important alert: (current site time 7/15/2013 2:58:25 PM EDT)
 

winzip icon

A (part11) Oracle with Java using J2EE Architecture

Email
Submitted on: 12/5/2003 3:12:05 AM
By: James Smith K  
Level: Beginner
User Rating: By 7 Users
Compatibility: Java (JDK 1.1), Java (JDK 1.2)
Views: 26312
(About the author)
 
     This had always been the most Complicated Subject to Handle Beacuse of Improper and Bad Documentations available over the net and Books u read , Thats one of the Reasons i delayed in writing in This Article and Most of the books never seem to answer your question. Oracle J2EE Setup is something which requires TEAM WORK and u should have very good relation with ur DBA , The man who setup your Oracle Server complete Article Available at my site http://www.geocities.com/james_smith73

 

HTML:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
//HTML for :A (part11) Oracle with Java using J2EE Architecture
//**************************************
Hi Friends 
This article is about Connecting Java in particular Java Server Pages with Oracle 9i Database using Java 2 Enterprise Edition J2EE Specifications, This is more of a practical approach from a programmers perspective than a completely theory driven article, We start of with the Assumption that oracle 9i Server is Installed and well configured and you are running Windows 2000 as a client to access this server and having 256MB RAM and Intel Pentium 4 Processor,
Initially we will setup Oracle Client using tnsnames.ora then Install J2SE ( Java 2 Platform Standard Edition) and J2EE ( Enterprise Java Software), then configure the Windows 2000 or XP System to understand J2EE and J2SE, 
Our Next step will be to write a JSP Code, which will 
1. Import Necessary Java Classes
2. Get the Initial Parameters from web.xml file
3. Build a small Database Query or Select statement based on this
4. Connect to Oracle Database using Data Source lookup of JNDI *
5. Display records in the result set and close connection
* JNDI – Java Naming and Directory Interface
	Once the coding is done it will be deployed on a J2EE Server using Deploy Tool from Sun Microsystems which comes with J2EE 1.3.1 Installation package
	Handle Possible Errors which might come in while Deploying or Calling the JSP Code to Connect to Database, Solve these errors and Display a final output where a JSP connects to a Oracle Database to show students records in a Database, 
	For Security Purpose the Server Name, DB Username, DB Password and other parameters, which are given in the article are Dummy and u must consult your Oracle Database Administrator to get real access to the server provided u have permission.
	However this article does not cover the work the DBA has to do like creating tables, performance tuning, Oracle Server Setup etc., This article can be viewed from a Java Programmers Perspective and the way a Programmer can Handle Mostly Misleading Oracle Errors like for Instance when u get an Error ORA-00600: internal error code, arguments: [ttcgcshnd-1] your DBA MIGHT look into Oracle Errors in oracle site and suggest this error is because “This error occurs when both addresses, read and calculated, contain some large numbers. Possible reasons are an incorrect entry in the block header (pointing to non-existent block) due to faulty memory modules, or the block is part of a large database file (greater than 2GB) and the block is written in the wrong place …” and suggest to apply patched u say Oh my God … with a sign on your face 
But the Simple solution to complicated problem can be using proper version of classes12.zip file in classpath, the complete article is available online at my site http://www.geocites.com/james_smith73 under Java Section Oracle Link
Due to heavy traffic and limited Bandwidth Allotted on this free site sometimes u may get a message from Geocities server saying site temporarily unavailable in that case u made access the same after sometime.
Best Regards
James Smith
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
12/27/2004 5:54:35 AM

Boy! Some code. Have all the 5 black balls for the code. I needed to have a code that can connect to An Oracle database and here i have one.
Thanks buddy
(If this comment was disrespectful, please report it.)

 
7/5/2005 11:12:18 AMTom Demets

It's obvious you have made a great effort while making this. Very useful!
Five globes from me!
Tom
www.codenation.be
(If this comment was disrespectful, please report it.)

 
11/14/2005 5:26:57 AMsandipan

first of all thanks a lot for helping people like us. its an earnest request to u that plz send me some very practical oriented tutorials that i badly need.
thank u again
(If this comment was disrespectful, please report it.)

 
4/14/2006 12:27:28 AMdeepak

very goog work
(If this comment was disrespectful, please report it.)

 
2/20/2007 8:02:53 AMGAURAV

Very useful!

(If this comment was disrespectful, please report it.)

 
3/7/2007 7:19:56 AMdipak hadiya

give me this code
(If this comment was disrespectful, please report it.)

 
4/30/2007 5:36:27 AMRevathi

Very useful for all.
Thank u.
(If this comment was disrespectful, please report it.)

 
7/31/2008 11:30:02 AMritesh

this is nice source code.
(If this comment was disrespectful, please report it.)

 
12/3/2008 7:29:57 AMvaibhav

I like it
(If this comment was disrespectful, please report it.)

 
9/26/2009 2:44:16 AMbenjie

I'm so glad to get access your site...
it's so cool and helpful for study..
Thank you so much...

May God us all....
(If this comment was disrespectful, please report it.)

 
2/6/2010 1:53:51 PMSagar

i want the java code to store any type of file to database direclty with all type of permission like oracle or ms-access

thank u........

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.