There needs to be more sleep hours in the day. I could have used a bit more sleep this morning let’s face it. But that’s not going to happen now. Oh great I have hiccups now. I don’t know where that came from. Let’s see if I can hold my breath. If that helps then the hiccups will be gone and everything will be fine and dandy. Nope that’s not happening either. Dang it. Maybe I’ll get there maybe.
Sometimes you need to connect to a database. Here is some code that will allow you to connect to an SQLite database using Java.
public static Connection connect() {
Connection conn = null;
try {
conn = DriverManager.getConnection("jdbc:sqlite:sample.db");
} catch (SQLException sqle) {
sqle.printStackTrace();
Logger.getLogger(SQLite.class.getName()).log(Level.SEVERE, null, sqle);
}
return conn;
}
Comments
Post a Comment