java - How can we detect the content of ENUM field using JDBC? -


I am in the process of creating code generators for my CRUD Java Web database application In creating its form page, I want to be able to present the ENUM area data type in Therefore, it is defined in a MySQL script:

  'employment status' enum ('CPNS', 'PNS') colot Latin 1_general_ci not tap,   < P> combo box ( & lt; SELEC / & gt;  html input as p   employment status  as  CPNS ,  PNS Type) use the  form of your content.  

How can I tell the contents of that area from the database using JDBC ??? thanks a lot!

PS: Ask me something, why do I want to create my own code generator ??? Okay, I think it will be very fun to do this, and will add our alternate options in the Java web universe .. :)

 database metadata meta = conn.getMetaData (); RsColumns = meta.getColumns (empty, "%", "", "%"); / * Received column (string catalog, string schema pattern, string tablename pattern, string columnname pattern) * / while (rsColumns.next ()) {string column type = rs column .getString ("TYPE_NAME"); String columnname = rsColumns.getString ("COLUMN_NAME"); }  

I think it can help you

Comments