Please let me know,
How do i check from java that
if a table exists in oracle
it must not create a new one
create a new one.
when i gave
select count of *from tablename;
it said no of rows = some int.
i checked a table is there but when table is not there
it gave me an exception
"table or view does not exist"
should i write my code to create the table inside the exception block. ?
could some one tell me the best practice in this case !!!
thanks for your help in this.
Originally posted by Paul Sturrock:
All databases have a catalog you can query to find out meta data about the database itself. In Oracle you can check a table called user_tables for example. However, a better way to do this is to use the DatabaseMetaData class which gas a getTables() method you can use to find out what tables exist. Doing it this way means your code is not Oracle specific.
Thanks for the idea.
Am trying to implement the same.