I have a 300GB sqlite database with over billions of records. It is stored locally on a machine.
I want to search for data in the sqlite database and return the row if it is found. I want to retrieve data from this sqlite database based on values from the csv file.
String csvfile = "C:/documents/parsed - Copy.csv";
String line = "";
String csvSplitBy = ",";
BufferedReader br = new BufferedReader(new FileReader(csvfile));
String sql = "select substr(hex(column1),5,12),column2,colum3 from table1 where substr(hex(column1),5,12) = ?";
try (Connection conn = this.connect();
PreparedStatement stmt = conn.prepareStatement(sql)){
while ((line = br.readLine()) != null) {
String[] cols = line.split(csvSplitBy);
stmt.setString(1, cols[1]);
ResultSet rs = stmt.executeQuery()
if (rs.next()) {
System.out.println("found");}
else
System.out.println("not found");
How can I search the database based on values from a separate smaller csv file and not take forever?