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;");
        Statement s = conn.createStatement();
        s.execute("CREATE USER Tim pwd");
        System.out.println("User 'Tim' created.");
        s.execute("DROP USER Tim");
        System.out.println("User 'Tim' dropped.");
        s.close();
        conn.close();
    }
}