0

I am currently making a mobile forensic toolkit for a project I have been given. I have hit a dead end and hoping someone could help me.

On Android, text messages, call logs, contacts etc are all saved as .db files and I am hoping I can populate a JTable to show the results when pressed on a specific button. For example you click view texts and the JTable fills with all the text messages on the phone. Also the .db files are full of columns that I will not need to show so is there a way to only select the columns that I do want to us?

Himanshu
  • 31,810
  • 31
  • 111
  • 133
p_dibb
  • 1
  • 2
  • Any idea of what the format of the .db file is? If it is a database, do you know which one, the credentials needed to access it? If it is the case, you could use [ResultSetTableModel](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CFsQFjAA&url=http%3A%2F%2Fcs.fit.edu%2F~mmahoney%2Fcis5100%2Fexamples%2Fch25%2FFig25_28_31%2FResultSetTableModel.java&ei=jukWULS0GcT2sgb8-oDoCQ&usg=AFQjCNF2nrGzbIPxMd_9XoEoSU5HnmOgug) and by extending it, you could restrict the columns using an appropriate query. – Guillaume Polet Jul 30 '12 at 20:12
  • Its definitely a database as I can view the contents using a SQLite Database Browser. But I dont know how to find out what sort of database it is – p_dibb Jul 30 '12 at 20:32
  • Follow @antix solution and add the SQLLite JDBC driver to your classpath. Create an SQL query that returns the information you want. Then I would consider using the TableModel I suggested above passing the connection information and the query, set it on a JTable and display that in a JFrame. – Guillaume Polet Jul 30 '12 at 20:38
  • Right I have added the SQLite JDBC to my classpath. Do you have any code to show the next steps? – p_dibb Jul 30 '12 at 20:59
  • Read [this O'Reily article](http://www.oreillynet.com/pub/a/oreilly/java/news/javaex_1000.html) about this question. You can download an example code at the end of the artice. – Guillaume Polet Jul 30 '12 at 23:22
  • Hi thanks for your reply but I have noticed that the displaying the database is for a servlet and uses sql to log in. But the database i am trying to display is saved on removable drive. Does this make a difference or not? – p_dibb Jul 31 '12 at 19:08
  • No, it does not matter. As you can see inside the ResultSetTableModel, there is no reference to `javax.servlet` package nor any other JEE/Servlets package. It seems that you need to use the driver from [here](http://code.google.com/p/sqlite-jdbc/) and there is an explanation in this [wiki](http://code.google.com/p/sqlite-jdbc/wiki/Introduction#How_to_Specify_Database_Files) explaining how to access SQLLite database files. (Note: I am no expert in SQLLite but I do know my way around in Java) – Guillaume Polet Jul 31 '12 at 19:23

1 Answers1

3

I would use SQLite JDBC driver to access these DB files.

Java and SQLite

Then bind JDBC data to JTable as described here:

How to fill data in a JTable with database?

See also: https://stackoverflow.com/questions/2149438/tool-to-see-android-database-tables-and-data

Community
  • 1
  • 1
anttix
  • 7,709
  • 1
  • 24
  • 25