hi-
i would like to know a little about the process for updating a mysql
table when you use a table editor in SWT (not the jface method).
this is how the table items are represented in my program.
try
{
String[][]records=
myObject1.executeQuery(s);
for(int i=0;i<records.length;i++)
{
String[] record =records[i];
TableItem item = new TableItem(table, SWT.NULL);
item.setText(records[i]);
//System.out.println(records[i]);}
}
is one way to approach it something like ...
char charArray[]=records[i].toCharArray();
and then use the promotion rules for
java and call the appropriate method like updateString(),updateInt(),
updateDouble()?? the reason i would take this approach some of the time
is i am not sure of the promotion rules on string but do on char.
i already used a tableEditor and had an updateable resultSet and updated
a varChar with updateString().
i just want to make sure i have the right idea.
i plan on just working with the more basic types in my tableEditor.
thanks very much,
jim
thanks,
jim
dodo1548 - 06 May 2005 06:20 GMT
hi-
i think i found another way.
in the book i am reading it says
"getter methods provide for data-type specific retrieval of column values
from the current row".
so i just need to send the cursor to the right row in the resultset
and use a getter method. then i can call the appropriate update method.
that is a lot simpler than that other funny plan i was trying to come
up with.
i suspected there must be a better way.
i should be able to solve it from here.
thanks,
jim