CLICK HERE TO EARN MONEY FREE

Sunday, January 13, 2013

DATABASE CONNECTOR IN JAVA USING MSACESS


DATABASE CONNECTOR IN JAVA USING MS ACESS
 try
        {
             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection  conn=DriverManager.getConnection("Jdbc:Odbc:man","","");
      Statement stmt=conn.createStatement();
      String query="insert into hai VALUES('"+fn+"','"+ln+"','"+Age+"','"+phone+"','"+la+"')";
stmt.executeUpdate(query);
                        out.println("sucess");
        }
        catch(Exception e)
        {
        }
man means its database name
hai means its database table  name

0 comments:

Post a Comment

 

TEKONOLOGY Copyright © 2011 -- Template created by TEKONOLOGY -- Powered by Blogger