Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Main {
    public static void main(String args[]) throws Exception {
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};"
                + "DBQ=C:\\Users\\Public\\uls\\ulsTest.mdb;" + "SystemDB=C:\\Users\\Public\\uls\\Security.mdw;"
                + "Uid=Gord;" + "Pwd=obfuscated;" + "ExtendedAnsiSQL=1;");

        String UID = "Tim";
        String oldPWD = "oldpassword";
        String newPWD = "I like Java";

        Statement s = conn.createStatement();
        s.execute("ALTER USER " + UID + " PASSWORD \"" + newPWD + "\" \"" + oldPWD + "\"");

        s.close();
        conn.close();
    }
}