mardi 24 novembre 2015

How read a Blob field of a sqlite database using java?

I'm trying to get all the fields in a contact database that has an image but not how to get them, and I 'm getting the label of the columns to see if they exits.

Class.forName("org.sqlite.JDBC");
connection = DriverManager.getConnection("jdbc:sqlite:C:\\MiDB.db");
statement = connection.createStatement();
resultSet = statement.executeQuery("SELECT * FROM contacto");
while (resultSet.next()){
      i++;
      System.out.println("out: "+resultSet.getMetaData().getColumnLabel(i));
}

Aucun commentaire:

Enregistrer un commentaire