i use ucanaccess and get the error(error in connection)i also add the .jar files in p

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amirhan
    New Member
    • Jun 2017
    • 3

    i use ucanaccess and get the error(error in connection)i also add the .jar files in p

    private void jButton1ActionP erformed(java.a wt.event.Action Event evt) {
    String s1,s2;
    s1=u.getText();
    s2=p.getText();
    try{
    Class.forName(" net.ucanaccess. jdbc.Ucanaccess Driver");
    Connection con=DriverManag er.getConnectio n("jdbc:ucanacc ess://C://Users//awagold//Documents//test123.accdb") ;
    Statement st=con.createSt atement();
    int a=st.executeUpd ate("insert into test123 values('"+u+"', '"+p+"')");
    if(a==1){
    res.setText("In serted");

    }else{
    res.setText("no t Inserted");
    }
    }
    catch(Exception e){
    System.out.prin tln("Error in Connection");
    }
    }
  • amirhan
    New Member
    • Jun 2017
    • 3

    #2
    Error is Error in Connection

    Comment

    • chaarmann
      Recognized Expert Contributor
      • Nov 2007
      • 785

      #3
      you have given no password in your connection string. Also, please list the complete details of the connection error description here. It will be meaningless for you, but not for the expert.

      It also may be better for you if you list this eror in the database forum.

      Comment

      • amirhan
        New Member
        • Jun 2017
        • 3

        #4
        Thanks alot but today i solve this problem...!!!

        Comment

        • chaarmann
          Recognized Expert Contributor
          • Nov 2007
          • 785

          #5
          Nice to hear! Can you please let us know how?
          Your post will be read by hundreds of users who wants to know how such a problem is solved. If you are telling them, then you are really thankful. One hand washes the other....

          Comment

          Working...