aspose file tools*
The moose likes JDBC and the fly likes How to get a Table Schema from oracle database to Java Programs...? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to get a Table Schema from oracle database to Java Programs...?" Watch "How to get a Table Schema from oracle database to Java Programs...?" New topic
Author

How to get a Table Schema from oracle database to Java Programs...?

Moguluri Ravi Kiran
Ranch Hand

Joined: Apr 16, 2010
Posts: 62

My intention is to create a file

<table_name>.sql from that resembles a already stored file in database...

for example ...

say EMP is a Table with
Ename varchar2(10) not null,
Eid varchar2(5) not null
sal number(7,2) not null...

now i want that information back 2 my java program ........as it was....

im facing problems with ResultSetMetaData's functions getColumnType()
getColumnTypeName() etc....

is there any method 2 copy simply all the above schema as a String into my Java Program.





And Problems are ......

Mappings
********

SQL VALUE GETCOLUMNTYPE GETSCALE GETPRECISION

****************************************************************

NUMBER DOUBLE PRECISION 0 15

VARCHAR2(12) VARCHAR2 0 12

NUMBER(4) DECIMAL 0 4

VARCHAR2(10) VARCHAR2 0 10

VARCHAR2(9) VARCHAR2 0 9

NUMBER(4) DECIMAL 0 4

DATE DATE 0 19

NUMBER(7,2) DECIMAL 2 7

NUMBER(7,2) DECIMAL 2 7

NUMBER(2) DECIMAL 0 2

**************************************************************

Now i required to convert JAVA output to SQL.......Feeling more burden.....

is there any solution ?



Thanks in Advance..
 
Don't get me started about those stupid light bulbs.
 
subject: How to get a Table Schema from oracle database to Java Programs...?