I have the datasoure and drivers set up, but for some reason this code is not updating the database.
import java.sql.*;
public class TestCreateCoffeeTable
{
public TestCreateCoffeeTable()
{
}
public static void main(String[] args)
{
try
{
String createStatement;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dataSource = "jdbc:odbc:Coffeebreak";
Connection con = DriverManager.getConnection(dataSource);
Statement statement1 = con.createStatement();
[B]String insert;
//add the info
insert = "INSERT INTO Coffeebreak VALUES( 'Bob', 24, 23)";
statement1.executeUpdate(insert);[/B]
}
catch(ClassNotFoundException cnfe)
{
System.err.println(cnfe);
}
catch(SQLException sqle)
{
System.err.println(sqle);
}
catch(Exception e)
{
System.err.println(e);
}
}
}
I'm sure that the problem has to be with what's in bold, but it looks right...
I do have the code that created the table if you need that. It created three columns, Name, ID_NUM, and Pay...But none of those are being populated.