iSelfSchooling.com - Copyright © 1999-2009 iSelfSchooling.com ||  References  |  Job Openings
    Home  | Search more...  |  FREE Online VIDEO Oracle Training 

   Unlimited access!   

    Oracle  Syntax  | Suggestions

Copyright & User Agreement

Email2aFriend  | Homepage us! |  Bookmark

Products/Services

 Vision/Mission

 Community Sharing

 Services

  Products

 Biography

 Contact Us

 FAQ

 Current News

 Website Traffic

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

Topics: Hands-On 08

 

Your organization is now asking you to write a simple java program to identify a special problem that can be classified by iselfschooling’s problems only.

 

More Resources by Google:

Manuscript

-- Hands-On 08 (JAVA Stream) 

SET ECHO ON 
CLEAR SCR

CLEAR SCR
-- Connect to SQLPLUS as the system/manager user.
--
pause

CONNECT system/manager
pause 

CLEAR SCR
-- Check to see that you have the JAVA tool installed. 
--
pause

SELECT COUNT(*) FROM dba_objects 
WHERE object_type LIKE 'JAVA%' 
/
-- This response, indicates that the JAVA tool was 
-- previously installed successfully. 
-- If you get a number less than 1200, you may have
-- had problems with the installation process. And 
-- we recommend that you re-install the JAVA component.
-- 
pause

CLEAR SCR 
-- Also Check the JAVA pool memory usage.
--
pause


SELECT * FROM v$sgastat 
WHERE pool LIKE 'java%' 
/
-- You must have at least 30 megabytes of memory.

-- Notice that the amount of FREE MEMORY + MEMORY IN USE should
-- add up to more than 30 megabytes.

-- We have more than enough memory allocated for JAVA.
--
pause 

CLEAR SCR
-- Connect to SQLPLUS as the iself user.
--
pause

CONNECT iself/schooling
pause


CLEAR SCR
-- Create an iself java class, to return the iselfschooling messages.
-- 
pause

CREATE OR REPLACE JAVA SOURCE NAMED "iself" AS 
public class iself { 
static public String message (String tail) { 
return "iSelfSchooling-" + tail; 


/
pause 

CLEAR SCR
-- Publish the JAVA class to SQL by creating a PL/SQL
-- function.
-- Notice that JAVA programing is very case sensitive.
-- 
pause

CREATE OR REPLACE FUNCTION error_msg (str VARCHAR2) 
RETURN VARCHAR2 
AS 
LANGUAGE JAVA NAME 
'iself.message (java.lang.String) 
return java.lang.String'; 
/
-- This is an example of how to call JAVA from PL/SQL in Oracle9i.
pause 

CLEAR SCR
-- Test the error message function.
-- 
pause

SELECT error_msg ('01320: Running JAVA was successful.') 
as "Message Function"
FROM dual
/

-- This is an example of the iselfschooling message function.
pause

CLEAR SCR
-- Drop the JAVA source and the error_msg function.
--
pause
DROP JAVA SOURCE "iself"
/

DROP FUNCTION error_msg
/
-- You have dropped the created objects so that you can repeat these
-- steps over and over again.
pause

CLEAR SCR
-- Now, Practice this hand-on over and over
-- until you become a master at it.

-- For more information about the subject, you are encouraged
-- to read from a wide selection of available books.

-- Good Luck!
pause

 

 
 
Google
 
Web web site