Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Invalid thread access - On using progress bar(Invalid thread access - On using progress bar)
icon8.gif  Invalid thread access - On using progress bar [message #1131283] Thu, 10 October 2013 07:32 Go to next message
Eclipse UserFriend

Hi,

When ever i try to use progress bar for the data retriving & loading into the tableviewer... I am facing this issue

1. I wanted user to wait for still loading data's from the DB into the tableviewer
2. The Progress bar with status to display
3. i went to the ProgressMonitorDialog, IProgressMonitorWithBlocking & also Display.getDefault.async & sync as well...
4. but when ever i use any of these i am always getting 'Invalid Thread Access'
5. if i remove accessing DB then its working fine.

My code as below


String sqlStatement = "SELECT * FROM SAMPLE WHERE CLASS = '"
+ className + "'";
Statement stmt = null, stmt1 = null;
ResultSet rs = null, rs1 = null;
if (cn != null) {
try {
stmt = cn.createStatement();
stmt.executeQuery(sqlStatement);
rs = stmt.getResultSet();
viewerObjects.clear();
while (rs.next()) {
sqlStatement = "SELECT PARAMS FROM PSLMAPMETHOD WHERE CLASS LIKE '"
+ className
+ "' AND METHOD LIKE '"
+ rs.getString(1) + "'";
stmt1 = cn.createStatement();
stmt1.executeQuery(sqlStatement);
rs1 = stmt1.getResultSet();

if (rs1.next())
viewerObjects.add(rs.getString(1) + "~"
+ rs.getString(2) + "~" + rs1.getString(1));
rs1.close();
stmt1.close();
}
sysmaplabelTableViewer
.setContentProvider(new TableListContentProvider());
sysmaplabelTableViewer
.setLabelProvider(new ProfileTableListLabelProvider());
sysmaplabelTableViewer.setInput(viewerObjects);
sysmaplabelTableViewer.refresh();

if (viewerObjects.size() == 0) {
headerMessage
.setText("Invalid class name. No matching class name was found in METHOD.");
} else {
selectedClass = className;
}
} catch (java.lang.Exception ex) {
ex.printStackTrace();
} finally {
try {
rs.close();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}

These implementation in the method 'populateMethods(String className) {'
The method call rapped around any of these progresss Dialog

Please let me know where i went wrong...
Thanks in advance...
Re: Invalid thread access - On using progress bar [message #1131291 is a reply to message #1131283] Thu, 10 October 2013 07:41 Go to previous message
Eclipse UserFriend
ProgressMonitorDialog is from jface, so asking this question in their forum is more likely to yield a useful answer.
Previous Topic:Matlab?
Next Topic:Classpath Dependency Validator for user libraries
Goto Forum:
  


Current Time: Mon Apr 28 06:21:05 EDT 2025

Powered by FUDForum. Page generated in 0.03108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top