Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / February 2005

Tip: Looking for answers? Try searching our database.

program does not execute SQL line.

Thread view: 
dan dan - 28 Feb 2005 03:05 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
Robert Klemme - 28 Feb 2005 11:11 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
[quoted text clipped - 23 lines]
>
> }//end if

The code is far from complete.  Please post complete code and use proper
indentation.

Regards

   robert


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.