How to set a TableColumn-type?!? [message #446708] |
Wed, 01 December 2004 09:20 |
Eclipse User |
|
|
|
Originally posted by: melko.gmx.at
hello!
I have a problem: I select items from a database to a table and it works
fine.
I do it on this way:
ResultSet resSet = stmt.executeQuery(text);
ResultSetMetaData result = resSet.getMetaData();
int col = result.getColumnCount();
TableColumn[] tableColumn = new TableColumn[col];
for(int i=1; i<=col;i++){
tableColumn[i-1] = new TableColumn(table, SWT.LEFT, i-1);
tableColumn[i-1].setText(result.getColumnName(i));
And I get the results in the table and so on. But I want to set the Column
type to DATE or CHAR or INTEGER depending on the
result.getColumnType(i)!?!?! so I can, if there is a DATE-Column in the
databse show it right!?
Example:
In the DB there is a Column "Birthday" DATE and it should show only the
Date without time, but it shows follow: 1983-05-01 00:00:00.000000
or other example:
"user_jahr" is a DECIMAL and it should show 25 but I get
25.0000000000000000
Is it possible to do something there or not?!
Thank you for your help!!
Nice greetings from austria!
Have a nice day
|
|
|
|
Powered by
FUDForum. Page generated in 0.03440 seconds