I am get this error
java.sql.SQLExc eption: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
my code for connection is
java.sql.SQLExc eption: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
my code for connection is
Code:
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:MyDataSource1");
ps=con.prepareStatement("Select * from Reservation where TravelDate=? and FlightNo=?");
ps.setString(1,t1.getText());
ps.setString(2,t2.getText());
rs=ps.executeQuery();
rs.next();
t3.setText(Integer.toString(rs.getInt(3)));
t4.setText(Integer.toString(rs.getInt(4)));
t5.setText(Integer.toString(rs.getInt(5)));
con.close();
}
Comment