• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 63
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic