Here you can find the source of getUniqLabels()
public static List<String> getUniqLabels()
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> getUniqLabels() { Connection c = null;/*from ww w . j a v a 2s . c o m*/ Statement stmt = null; List<String> outputs = new ArrayList<String>(); try { Class.forName("org.sqlite.JDBC"); c = DriverManager.getConnection("jdbc:sqlite:dbs/newpress.db"); c.setAutoCommit(false); // System.out.println("Opened database successfully"); stmt = c.createStatement(); ResultSet rs = stmt.executeQuery("SELECT distinct(LABEL) from DOC_LABEL order by LABEL;"); String label; while (rs.next()) { label = rs.getString("LABEL"); outputs.add(label); } rs.close(); stmt.close(); c.close(); } catch (Exception e) { System.err.println(e.getClass().getName() + ": " + e.getMessage()); System.exit(0); } return outputs; } }