hi friends, what all i want is what query should i fire to get all the object names like tables,vies etc in a database. in oracle it is "select * from cat" or "select * from tab" but I want to know the exact query for MS-access or SQL-server. thanks in advance.
hi harjit, i think i can try helping u There is this method called getMetaData() in Connection interface that gives you info about the database. call this method.This returns an object of DatabaseMetaData . just say, DatabaseMetaData dmeta= con.getMetaData(); //con in of Connection The method getTables of DtabaseMetaData gives all the objects associated with a specific database Say, ResultSet rs= dmets.getTables(null,null,"%",null) where the paramter 1 represesnts the schema 2 represents the catalog 3 represents the patterns of table desired 4 represents the types of tables(system,view,general etc then iterate thru the resultset as usual and using the getSrting(n) where n is the column number get the appropriate name of the object. this should do.and i hope i have solved your problem And people,please free to correct me,if i'am wrong. seema kamath
Hey Folks, First of all thanks a lot for this post of yours, it helped me a lot. I would like to know if you have any idea about this - I want to query the system tables directly e.g "MSysRelationships" how can I do that ? I tried to query the tables directly using the "executeQuery()" method of the "Statement" object, but it does not allow me to access System tables.