version 1.76, 2004/08/18 11:14:51
|
version 1.77, 2004/09/20 11:57:41
|
Line 26 import java.io.PrintStream;
|
Line 26 import java.io.PrintStream;
|
import java.io.UnsupportedEncodingException; |
import java.io.UnsupportedEncodingException; |
import java.net.URL; |
import java.net.URL; |
import java.sql.PreparedStatement; |
import java.sql.PreparedStatement; |
|
import java.sql.ResultSet; |
import java.sql.SQLException; |
import java.sql.SQLException; |
import java.sql.Statement; |
import java.sql.Statement; |
import java.sql.Types; |
import java.sql.Types; |
Line 38 import java.util.StringTokenizer;
|
Line 39 import java.util.StringTokenizer;
|
import java.util.TreeSet; |
import java.util.TreeSet; |
import java.util.Vector; |
import java.util.Vector; |
|
|
|
import javax.swing.JDialog; |
|
import javax.swing.JLabel; |
|
import javax.swing.JPanel; |
|
|
import com.exploringxml.xml.Node; |
import com.exploringxml.xml.Node; |
import com.exploringxml.xml.Xparse; |
import com.exploringxml.xml.Xparse; |
|
|
Line 2067 class Convert
|
Line 2072 class Convert
|
String tempQueryDest = destQuery; |
String tempQueryDest = destQuery; |
// remove extra query parts destQuery.substring(0,destQuery.lastIndexOf(destTableName)+destTableName.length()+1); |
// remove extra query parts destQuery.substring(0,destQuery.lastIndexOf(destTableName)+destTableName.length()+1); |
System.out.println("new Query " + tempQueryDest); |
System.out.println("new Query " + tempQueryDest); |
|
System.out.println("idfield "+idField+" "+ids.get(tbIndex).toString()); |
if (!idField.equals("")) |
if (!idField.equals("")) |
{ |
{ |
long startTime = System.currentTimeMillis(); |
long startTime = System.currentTimeMillis(); |
Line 2080 class Convert
|
Line 2086 class Convert
|
dialog.title.setText("Check if data is available"); |
dialog.title.setText("Check if data is available"); |
else if (dialog != null) |
else if (dialog != null) |
dialog.title.setText("Check if more data is available"); |
dialog.title.setText("Check if more data is available"); |
|
|
myIds = bean.getIDVector(ids.get(tbIndex).toString(), (String) names.get(tbIndex), tempQuery, 0); |
myIds = bean.getIDVector(ids.get(tbIndex).toString(), (String) names.get(tbIndex), tempQuery, 0); |
myIdsDest = beanDest.getIDVector(convertText(idField), destTableName, tempQueryDest, 0); |
myIdsDest = beanDest.getIDVector(convertText(idField), destTableName, tempQueryDest, 0); |
//System.out.println("status of remove "+myIds.remove("b015892")); |
//System.out.println("status of remove "+myIds.remove("b015892")); |
|
System.out.println("ids found for "+idField+" "+!myIds.isEmpty()); |
if (myIds.isEmpty()) |
if (myIds.isEmpty()) |
break; |
break; |
vec = new Vector(myIds); |
vec = new Vector(myIds); |
Line 3914 class Convert
|
Line 3922 class Convert
|
command.append("WHERE " + idField + " = ?"); |
command.append("WHERE " + idField + " = ?"); |
return command; |
return command; |
} |
} |
|
public void makeTest(String table,String idField,String tempQuery) throws Exception |
|
{ |
|
int counter=0; |
|
|
|
// ****** test code ***** |
|
|
|
bean.getConnection(); |
|
ResultSet resultSet=null; |
|
String lastResult ="P227634.11";//"P227625.79554";//"P227625.77391";//"P116034.970998"; |
|
String myQuery="select "+bean.getQC()+idField+bean.getQC()+",serial "+" from "+bean.getQC()+table+bean.getQC(); |
|
System.out.println("Query is now "+myQuery); |
|
JDialog statusDialog=new JDialog(); |
|
statusDialog.setTitle("Status Information"); |
|
JLabel status=new JLabel("actual DataSet : "); |
|
JLabel status2=new JLabel(Integer.toString(++counter)); |
|
JLabel status3=new JLabel(lastResult); |
|
|
|
JPanel statusPanel = new JPanel(); |
|
JPanel statusPanel2 = new JPanel(); |
|
statusPanel.add(status); |
|
statusPanel.add(status2); |
|
statusPanel2.add(status3); |
|
statusDialog.getContentPane().add(statusPanel,"North"); |
|
statusDialog.getContentPane().add(statusPanel2,"Center"); |
|
statusDialog.setLocation(400,500); |
|
statusDialog.setSize(300,150); |
|
statusDialog.setVisible(true); |
|
while (true) |
|
{ |
|
if (!statusDialog.isVisible()) |
|
statusDialog.setVisible(true); |
|
tempQuery = myQuery + " where " + bean.getQC() + idField + bean.getQC() + ">'" + lastResult + "'"; |
|
resultSet = bean.makeQuery(tempQuery, 1); |
|
if (resultSet == null) |
|
{ |
|
System.out.println("lastResult was " + lastResult + " counter was " + counter); |
|
break; |
|
} else |
|
{ |
|
resultSet.next(); |
|
lastResult = resultSet.getString(1); |
|
counter++; |
|
status2.setText(Integer.toString(counter)); |
|
status3.setText(lastResult+" "+resultSet.getString(2)); |
|
if(counter%100==0) |
|
{ |
|
System.out.println("actual Result was " + lastResult + " counter was " + counter); |
|
// break; |
|
} |
|
} |
|
resultSet = null; |
|
} |
|
System.exit(0); |
|
|
|
//****** end Test ****** |
|
|
|
} |
} |
} |
|
|