It's interesting that JDBC appears to provide support for this feature with
java.sql.ResultSetMetaData.getColumnLabel(int column). From what you've
stated below, it sounds like something that ODBC supports as well. Although
you didn't want to suggest a debate for adding this to MySQL, perhaps it is
something to add to the wish list after all.
In the meantime, you might want to create a "help" table that relates table
and column names to some help text, then create wrapper objects for the
ResultSet and ResultSetMetaData objects currently provided by the current
JDBC driver. The ResultSet wrapper would pass all the items currently
available from the MySQL ResultSet, and pass the wrapped ResultSetMetaData
object when requested. The wrapped ResultSetMetaData object would access
the DB for the help content when getColumnLabel() is called. I'm sure there
would be a more efficient way to do this than make another DB call, if
anyone has suggestions.
<mikemarkovich@amyski To: <java@stripped>
tchen.net> cc: <monty@stripped>, (bcc:
Subject: Column headings, titles, or
02/25/2003 09:38 AM
My understanding is that MySQL doesn't directly support meta data for table
columns. In other words, there appears to be no way to associate text to
describe the contents of a column with a column. For example, if I have a
column "ITEMNO" there appears to be no way to associate text "Item Number"
with the column. This text could be used to describe the contents of the
column or as a heading or title for the column.
I am working on a jdbc & java project to transfer data from a non-MySQL
database into a MySQL database. As part of the transfer process the data
is being optimized for reporting. My goal is to structure the data so that
it explains itself. To accomplish this it will be very helpful if I can
provide text to explain the contents of each column. Users will access the
database using a combination of ODBC and a variety of other tools such as
Crystal Reports, Excel, Cognos, and, heaven forbid, MS Access. With other
database products, namely, MS Access, ODBC is able to display the column
name and a column heading or description, but I haven't found a way to do
this using MySQL.
I asked a similar question a few months ago, so forgive me for bringing it
up again, but I find this to be a very vexing problem without an obvious,
robust solution. Am I missing something and this a non-issue because there
is a better way to accomplish this? If so, what is the other way? I would
appreciate any insight as to how others are handling this type of problem.
Please note, I don't care to start the debate as to whether or not MySQL
should add this feature - I'm just interested in what others are doing to
address this type of issue.
Before posting, please check:
http://www.mysql.com/doc/ (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <java-thread5092@stripped>
To unsubscribe, e-mail <java-unsubscribe-myl=capgroup.com@stripped>