Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / May 2005

Tip: Looking for answers? Try searching our database.

updateable result set -- mysql

Thread view: 
dodo1548 - 06 May 2005 02:45 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.