Results 1 to 4 of 4
  1. #1
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    160
    Rep Power
    5

    Default is the any special issue regarding the insertion in msacess 2007

    Hi all
    Is there any special feature to be keep in mind when iserting data to msacess 2007

    my problem regarding the insertion executeUpdate is getting op as 1 but when i open the databse's tabel the value i entered progrmicaly is not there

    if the same pgm if i put the query to select then the output will be correct

    is the any special issue regarding the insertion in msacess 2007


    Thank You

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Are you closing the statement and connection before checking whether the record is there. With MS Access you must close at least the statement, if not also the connection, before the changes take effect.

  3. #3
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    160
    Rep Power
    5

    Default how the password set in url

    thanks for the reply

    i got by bug correcected i didn't close the connection so the problem arise.

    in ms acess2007 i set password as opened with open exclusively option and set a password 123456
    my config file is

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class Config{
    public Connection con=null;
    public Config(){
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //String filename = "D://database//Man.mdb";
    String filename = "E://sss.mdb";
    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    database+= filename.trim() + ";DriverID=22;READONLY=true}";
    con = DriverManager.getConnection( database ,"","");

    /* Class.forName("com.mysql.jdbc.Driver").newInstance ();
    con=DriverManager.getConnection("jdbc:mysql://localhost/test?user=root&password=root");*/

    }catch(Exception ex){
    System.out.println("exception in com.manasa.config-------"+ex);
    }


    }

    }

    how the password is set in the url

    thank in advence

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Use the three argument version of getConnection. See the API docs. But, in any case, doesn't that "password=" tell you anything? And, BTW, that is not a config file.

Similar Threads

  1. XML with special characters
    By Kaizah in forum XML
    Replies: 1
    Last Post: 11-06-2009, 02:26 PM
  2. Regarding Data Insertion
    By adeeb in forum JDBC
    Replies: 1
    Last Post: 06-22-2008, 05:26 AM
  3. Using PreparedStatement for insertion
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-06-2008, 09:30 AM
  4. database insertion
    By abhiN in forum New To Java
    Replies: 0
    Last Post: 01-17-2008, 07:24 AM
  5. special characters
    By ravian in forum New To Java
    Replies: 2
    Last Post: 11-16-2007, 01:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •