Sleuth Kit Java Bindings (JNI)  4.10.2
Java bindings for using The Sleuth Kit
SQLHelper.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2020 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.datamodel;
20 
24 interface SQLHelper {
25 
26  // Get the type for the primary key
27  String getPrimaryKey();
28 
29  // Get the type for big int-type data
30  String getBigIntType();
31 
32  // Get the type for blob-type data
33  String getBlobType();
34 
35  // Get the description column name for the tsk_vs_parts table.
36  // This varies between SQLite and PostgreSQL.
37  String getVSDescColName();
38 
39 
43  class PostgreSQLHelper implements SQLHelper {
44 
45  @Override
46  public String getPrimaryKey() {
47  return "BIGSERIAL";
48  }
49 
50  @Override
51  public String getBigIntType() {
52  return "BIGINT";
53  }
54 
55  @Override
56  public String getBlobType() {
57  return "BYTEA";
58  }
59 
60  @Override
61  public String getVSDescColName() {
62  return "descr";
63  }
64  }
65 
69  class SQLiteHelper implements SQLHelper {
70 
71  @Override
72  public String getPrimaryKey() {
73  return "INTEGER";
74  }
75 
76  @Override
77  public String getBigIntType() {
78  return "INTEGER";
79  }
80 
81  @Override
82  public String getBlobType() {
83  return "BLOB";
84  }
85 
86  @Override
87  public String getVSDescColName() {
88  return "desc";
89  }
90  }
91 }

Copyright © 2011-2021 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.