Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String url = "jdbc:ucanaccess:\C:/Access.ACCDB";
- String query = "select * from [Donations]";
- try
- {
- java.sql.Connection con =DriverManager.getConnection(url, "","");
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery(query);
- while (rs.next())
- {
- System.out.println("Account No: " + rs.getString(1));
- System.out.println("Surname: " + rs.getString(2));
- System.out.println("First Name: " + rs.getString(3));
- }
- }
- catch(SQLException ex)
- {
- while (ex!=null)
- {
- System.out.println ("SQL Exception: " + ex.getMessage ());
- ex = ex.getNextException();
- }
- }
- catch(java.lang.Exception ex)
- {
- ex.printStackTrace();
- }
- String url = "jdbc:ucanaccess://www.filetolink.com/download/?h=eaa4aab688d25e270539868d712961ab&t=1467140283&f=3ca9ad1869;";
- String query = "select * from [Donations]";
- try
- {
- java.sql.Connection con =DriverManager.getConnection(url, "","");
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery(query);
- while (rs.next())
- {
- System.out.println("Account No: " + rs.getString(1));
- System.out.println("Surname: " + rs.getString(2));
- System.out.println("First Name: " + rs.getString(3));
- }
- }
- catch(SQLException ex)
- {
- while (ex!=null)
- {
- System.out.println ("SQL Exception: " + ex.getMessage ());
- ex = ex.getNextException();
- }
- }
- catch(java.lang.Exception ex)
- {
- ex.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement