program does not execute SQL line.
From: dan dan via JavaKB.com (forum_at_JavaKB.com)
Date: 02/28/05
- Next message: dar7yl: "Re: Does JDBC support compressed data communication"
- Previous message: Luke Webber: "Re: Does JDBC support compressed data communication"
- Next in thread: Robert Klemme: "Re: program does not execute SQL line."
- Reply: Robert Klemme: "Re: program does not execute SQL line."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Feb 2005 03:05:46 GMT
The coding below is part of my program, when i run my program, it only
executes until it prints out error and doesnt execute my SQL line to insert
the relevant data into the database..And when i compile, there is no error
to it...Can anyone help me debug if there is something that i type wrong?
And when i compile, there is no error to it...
if(input[i][0].equals("NM")==true )
{
for(int j =1;j<2;j++)
{
System.out.println("Inserting " + input[i][j]+ " into Database ..\t");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dataSourceName = "mdbTEST";
String dbURL = "jdbc:odbc:" + dataSourceName;
Connection con = DriverManager.getConnection(dbURL, "","");
System.out.println("Con Established..");
s = con.createStatement();
System.out.println("error");
s.executeUpdate("INSERT INTO " + TABLE_NAME + " (Name) VALUES ('"+ input[i]
[j] + "')");
rs.next();
System.out.println("error2");
}//end for
}//end if
-- Message posted via http://www.javakb.com
- Next message: dar7yl: "Re: Does JDBC support compressed data communication"
- Previous message: Luke Webber: "Re: Does JDBC support compressed data communication"
- Next in thread: Robert Klemme: "Re: program does not execute SQL line."
- Reply: Robert Klemme: "Re: program does not execute SQL line."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]