# mail class creating problem



## anuj6928 (Sep 25, 2010)

private void button1ActionPerformed(java.awt.event.ActionEvent evt) {
try
{ 
String NAME=T1.getText();
String BRANCH=T2.getText();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("Jdbc:Odbc:Anuj");
PreparedStatement st=con.prepareStatement("insert into REG(NAME,BRANCH) values(?,?)");
st.setString(1,NAME);
st.setString(2,BRANCH);
st.executeUpdate();	
}

catch(Exception e)
{

System.out.println(e);
}

/**
* @param args the command line arguments
*/
* public static void main (String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new registration().setVisible(true);
}*
});
}

// Variables declaration - do not modify
private java.awt.TextField T1;
private java.awt.TextField T2;
private java.awt.Button button1;
private java.awt.Label label1;
private java.awt.Label label2;
// End of variables declaration

}

in this bold section i had got an arror that ..." illegal start of expression..."
kindly help///..


----------



## andythepandy (Jul 2, 2006)

Hi,

I think the problem is that you haven't closed all the curly braces before your main function.
Try close one more before the bold section and see what happens


----------



## anuj6928 (Sep 25, 2010)

thanks.. man it s working bt... 1 more thing .. i m using netbeans 6.0 nd hoso i create DSN name as ... there is no MDB file created... pls sujjest me..


----------

