You could do it with a PreparedStatement like this...
Connection con = DriverManager.getConnection(...);
String sqlStr = "INSERT INTO Snippets (Author, DatePosted, Title, Code) VALUES(?, ?, ?, ?)";
PreparedStatement ps = con.prepareStatement(sqlStr);
ps.setString(1, authorl)...