Unix Technical Forum

SQL-DMO and ORACLE

This is a discussion on SQL-DMO and ORACLE within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi is there any equivalent of SQL-DMO for Oracle? I'd like to be able to enumerate, create objects like ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 11:13 AM
schw
 
Posts: n/a
Default SQL-DMO and ORACLE

Hi

is there any equivalent of SQL-DMO for Oracle? I'd like to be able to
enumerate, create objects like triggers on Oracle using JAVA. Shall I
just use JDBC thin driver? what are your opinions?

thanks

greets
schw

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 11:13 AM
oradbamohan@gmail.com
 
Posts: n/a
Default Re: SQL-DMO and ORACLE

Hi,

You can use the odbc thin driver to connect the oracle datbase. You can
create the oracle objects in oracle and the same objects you can create
in java and pass the same java object to oracle functions or
procedures.

You have insert program in java for emp object. In oracle create the
insert_emp function and pass the java object(same as in oracle object)
as a IN parameter to insert the java object values into oracle table.


The Oracle function is :

FUNCTION create_company(
o_company IN company_model,
p_company_id OUT thr_company.company_id%TYPE)
RETURN NUMBER
IS
BEGIN


INSERT INTO thr_company (
company_id,
company_name,
company_type,
address1,
address2,
city,
state,
zip,
url1,
url2,
url3,
phone,
fax,
link_elsewhere,
ticker_symbol,
company_logo,
status,
hcd_id,
thr_company_id,
country,
primary_id,
secondary_id,
primary_label,
secondary_label,
created_date)
VALUES(
p_company_id,
o_company.company_name,
o_company.company_type,
o_company.address1,
o_company.address2,
o_company.city,
o_company.state,
o_company.zip,
o_company.url1,
o_company.url2,
o_company.url3,
o_company.phone,
o_company.fax,
o_company.link_elsewhere,
o_company.ticker_symbol,
o_company.company_logo,
o_company.status,
o_company.hcd_id,
o_company.thr_company_id,
o_company.country,
o_company.primary_id,
o_company.secondary_id,
o_company.primary_label,
o_company.secondary_label,
SYSDATE);

COMMIT;

v_sql_identifier := 'SQL Section 2';
RETURN v_retval;
EXCEPTION
WHEN OTHERS
THEN
RAISE_APPLICATION_ERROR(-20001,SQLCODE || SQLERRM);
RETURN 1;
END;

Thanks,

Mohan Reddy G

schw wrote:
> Hi
>
> is there any equivalent of SQL-DMO for Oracle? I'd like to be able to
> enumerate, create objects like triggers on Oracle using JAVA. Shall I
> just use JDBC thin driver? what are your opinions?
>
> thanks
>
> greets
> schw


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:43 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com