KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > metadata > GetColumns


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 GetColumns 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         DatabaseMetaData md = getConnection().getMetaData();
29         ResultSet cols = md.getColumns(null, (String JavaDoc)inputs.getValue("schema"), (String JavaDoc)inputs.getValue("table"), "%");
30         Recordset rs = new Recordset(cols);
31         cols.close();
32         publish("columns", rs);
33         return rc;
34
35     }
36
37 }
38
Popular Tags