Hey Guys,
I am working on a search that takes in a value via textfield. Once taken in it should display another Jframe with the info but the searchbox crashes the second I run it.
Its some stupid mistake I have made or i have gone about it the wrong way but at this stage my brain is fried from lookin at this code and i am not making any head way.
The search box Code:
import com.sun.rowset.JdbcRowSetImpl;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Joe Lyons
*/
public class BB_Value_SearchBox extends javax.swing.JFrame {
/**
* Creates new form BB_Value_SearchBox
*/
public BB_Value_SearchBox() {
initComponents();
try {
JdbcRowSetImpl rowSet = new JdbcRowSetImpl();
String BB_Name = rowSet.getString("BB_Name");
} catch (SQLException ex) {
Logger.getLogger(BB_Value_SearchBox.class.getName()).log(Level.SEVERE, null, ex);
}
}
private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {
BB_Value_Results BVS = new BB_Value_Results(searchBoxTextField.getText());
BVS.setVisible(true);
dispose();
}
private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {
Main_Page MP = new Main_Page(null);
MP.setVisible(true);
dispose();
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(BB_Value_SearchBox.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(BB_Value_SearchBox.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(BB_Value_SearchBox.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(BB_Value_SearchBox.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new BB_Value_SearchBox().setVisible(true);
}
});
}
The Error I am getting when i run it :
BB_Value_SearchBox <init>
SEVERE: null
java.sql.SQLException: Invalid state
at com.sun.rowset.JdbcRowSetImpl.checkState(JdbcRowSetImpl.java:502)
at com.sun.rowset.JdbcRowSetImpl.findColumn(JdbcRowSetImpl.java:1680)
at com.sun.rowset.JdbcRowSetImpl.getString(JdbcRowSetImpl.java:1208)
at BB_Value_SearchBox.<init>(BB_Value_SearchBox.java:23)
at BB_Value_SearchBox$3.run(BB_Value_SearchBox.java:167)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Any help will be greatly appreciated. Or if you could just point me in the right direction.
Thanks