#  > Faadoo Engineers Zone - For Students in Engineering Colleges >  > Engineers Discussion Zone - Ask and resolve queries and so much more.. >  >  Please solve this java error in the code

## khem singh

I am using SQL Server 2005. I am getting this error while connecting with sql server from java. Using SQL Server Authentication. Login :S: a Table name=Registation
[microsoft][odbc sql server driver][sql server]invalid object name 'Registation'
Below is the connection code in java file in try-catch block.
public void Save()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection co=DriverManager.getConnection("jdbc:odbc:khem","sa","");
PreparedStatement stmt=co.prepareStatement("insert into Registation values(?,?,?,?,?,?,? )");
stmt.setString(1,t1.getText());
stmt.setString(2,t2.getText());
stmt.setString(3,ch.getSelectedItem());
stmt.setString(4,t4.getText());
stmt.setString(5,t5.getText());
stmt.setString(6,t6.getText());
stmt.setString(7,t7.getText());
stmt.executeUpdate();

JOptionPane.showMessageDialog(null,"value is Saved successfully");

}
catch(Exception ex1)
{
System.out.println("error found"+ex1);
}
} 








  Similar Threads: Java source code Source code of Notepad in JAVA?? Please any body solve this  java program problem with sql server 2005 ....please help Java Server Pages code Java code help...'

----------

