KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > metadata > GetTables


1 package metadata;
2
3 import dinamica.*;
4 import java.sql.*;
5
6 /**
7  * Base class to program business transaction services (read/write).
8  * All transactions will subclass this class.
9  *
10  * <br>
11  * Creation date: 29/10/2003<br>
12  * Last Update: 29/10/2003<br>
13  * (c) 2003 Martin Cordova<br>
14  * This code is released under the LGPL license<br>
15  * @author Martin Cordova
16  * */

17 public class GetTables extends GenericTransaction
18 {
19
20     /* (non-Javadoc)
21      * @see dinamica.GenericTransaction#service(dinamica.Recordset)
22      */

23     public int service(Recordset inputs) throws Throwable JavaDoc
24     {
25         
26         int rc = super.service(inputs);
27         
28         String JavaDoc types[] = {"TABLE"};
29             
30         DatabaseMetaData md = getConnection().getMetaData();
31         ResultSet tables = md.getTables(null, (String JavaDoc)inputs.getValue("schema"), "%", types);
32         Recordset rs = new Recordset(tables);
33         tables.close();
34         publish("tables", rs);
35         return rc;
36
37     }
38
39 }
40
Popular Tags