BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting a reference to a query column and DataSetView inform

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing
View previous topic :: View next topic  
Author Message
sdf
Guest





PostPosted: Mon Oct 25, 2004 1:53 pm    Post subject: Getting a reference to a query column and DataSetView inform Reply with quote



The following code is my entire JBInit() function. Please tell me what
the problem is. The issue relates to the section in {}. When I call the
section BEFORE the query.executeQuery() I get a NullPointer error when I
execute "exp_id_column.setAutoIncrement(true);". I believe this is
because there isn't a real resultset available which makes sense.
However, when I execute the {} section after the query.executeQuery()
function, I recieve an error that the dataset must be closed. My
question is, where can I execute my {} section? Also, is there a place I
can get good examples of this stuff including how to use the DataSetView()?

Anthony

this.getContentPane().setLayout(borderLayout1);
//Data Grid
JPanel grid_panel = new JPanel(new BorderLayout());
String sql = "select name, exp_id, type, remark, expression
from _system.cal_defn order by name, type";
dsview = new com.borland.dx.dataset.DataSetView();
com.borland.dx.sql.dataset.QueryDescriptor querydescriptor = new
com.borland.dx.sql.dataset.QueryDescriptor(dwa.DWA_Application.database,
sql, dsview, false, Load.ALL);
query = new com.borland.dx.sql.dataset.QueryDataSet ();
query.setAccumulateResults(false);
query.setQuery(querydescriptor);

query.executeQuery();
{
com.borland.dx.dataset.Column exp_id_column = query.getColumn(1);
exp_id_column.setAutoIncrement(true);
exp_id_column.setRowId(true);
query.setTableName("_system.cal_defn");
// query.setResolver(resolver);
}
table = new com.borland.dbswing.JdbTable ();
table.setDataSet(query);
JScrollPane scrollpane = new JScrollPane(table);
grid_panel.add(scrollpane, BorderLayout.CENTER);
this.getContentPane().add(grid_panel, BorderLayout.CENTER);


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.