hi,
        can you tell me which databaase you are using....?
        and what is the odbc configuration details...

guru

-----Original Message-----
From: Nandish Angadi [mailto:[EMAIL PROTECTED]]
Sent: 03 December 2001 11:26
To: [EMAIL PROTECTED]
Subject: Re: JDBC


Hi guru,
           i tried with placing setAutoCommit(true) at all the possible
place but the result is same
Regards

-----Original Message-----
From:   Raghupathy, Gurumoorthy
[SMTP:[EMAIL PROTECTED]]
Sent:   Monday, December 03, 2001 4:55 PM
To:     [EMAIL PROTECTED]
Subject:        Re: JDBC

hi,
        is the autocommit set to off at the biggening?
        if yes ....
        then use con.setAutoCommit( true ) before you execute the sql...
        or use the commit statement to explicilty commit the transaction.
guru

-----Original Message-----
From: Nandish Angadi [mailto:[EMAIL PROTECTED]]
Sent: 03 December 2001 11:17
To: [EMAIL PROTECTED]
Subject: JDBC


Hi all,
         I have a table with four data/time fields in the table. I want to
insert a row and i am using the sql command as "insert into table_name
values ({d \'yyyy-mm-dd\'},{d \'yyyy-mm-dd\'},{d \'yyyy-mm-dd\'},{d
\'yyyy-mm-dd\'})".I do not get a compile error nor a runntime error, but
when i check the database row is not inserted.

here is the code

        Connection con;
// creates a reference for Connection Class
                Statement st=null;
// creates a reference for Statement Class
                ResultSet rs;
                try
                        {

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// define the Driver
                                con =
DriverManager.getConnection("jdbc:odbc:"+dns,dnsName,dnsPassword); // Get
the Connection
                                st = con.createStatement();
// Create Statement
                                String sql = "Insert into
Budget_Project_Definition values (12,{d \'2001-12-03\'})";

                        int result = st.executeUpdate(sql);
                        System.out.println("A    "+result);
                        con.setAutoCommit(true);
                        }catch(Exception e){
                        e.printStackTrace();
                                }

Thanks in advance

Nandish

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to