Learn to Code by Making Art
Learn programming while your create computer art by copying code from my free guide.
https://splashofcode.com

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
java_introduction [2015/06/09 14:02]
Joel Dare [SQLite Library]
java_introduction [2015/06/09 14:03]
Joel Dare [Using Libraries]
Line 56: Line 56:
  
 I believe the colon (:) and semi-colon (;) are separators while the dot (.) indicates the current directory. I believe the colon (:) and semi-colon (;) are separators while the dot (.) indicates the current directory.
 +
 +Here's a full example of our Application.java file loading in the library and using it.
 +
 +<​code>​
 +import java.sql.*;
 +
 +public class Application {
 +
 + public static void main(String[] args) {
 +
 +     Connection c = null;
 +     try {
 +       Class.forName("​org.sqlite.JDBC"​);​
 +       c = DriverManager.getConnection("​jdbc:​sqlite:​hello.db"​);​
 +     } catch ( Exception e ) {
 +       System.err.println( e.getClass().getName() + ": " + e.getMessage() );
 +       System.exit(0);​
 +     }
 +     System.out.println("​Opened database (hello.db) successfully"​);​
 +
 + }
 +
 +}
 +</​code>​
Learn to Code by Making Art
Learn programming while your create computer art by copying code from my free guide.
https://splashofcode.com
comments powered by Disqus
java_introduction.txt · Last modified: 2015/06/09 14:03 by Joel Dare