problem with inserting data into database from JComboBox

here is my code

class SaveHandler4 implements ActionListener

{

String ind;

JComboBox ci;

public SaveHandler4(JComboBox ci)

{

this.ci=ci;

}

public void actionPerformed(ActionEvent ae)

{

int response = JOptionPane.showConfirmDialog(null,"Are you sure","Confirm",JOptionPane.YES_NO_OPTION);

if(response==0)

{

try

{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection conn = DriverManager.getConnection("Jdbc:Odbc:MyDataSource");

String Mysql = "INSERT into employee";

Mysql = Mysql + " (Title) ";

Mysql = Mysql + " VALUES(?) ";

PreparedStatement Ps = conn.prepareStatement(Mysql);

//ind=(String)ci.getSelectedItem();

Ps.setString(2,(String)ci.getSelectedItem());

Ps.setString(3,(String)capn.getSelectedItem());

Ps.setString(4,(String)cifc.getSelectedItem());

Ps.executeUpdate();

Ps.close();

/*tdate.setText("");

thfid.setText("");

note.setText("");

thfid.requestFocus();*/

}

catch(SQLException sq)

{

JOptionPane.showMessageDialog(null,sq.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);

}

catch(ClassNotFoundException E)

{

JOptionPane.showMessageDialog(null,E.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);

}

}

}

}

this is the eventhandler for a submit button that populates the database

but I get this error

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

pls help

[1594 byte] By [wildcarlosa] at [2007-11-26 14:26:52]
# 1
1. use code tags when you post code2. find out which line of code the NullPointer is happening on
SoulTech2012a at 2007-7-8 2:20:17 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...