Skip to content

Instantly share code, notes, and snippets.

@knight-ryu12
Created December 26, 2016 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knight-ryu12/2f34294eae5e8e45981d99177ce0f892 to your computer and use it in GitHub Desktop.
Save knight-ryu12/2f34294eae5e8e45981d99177ce0f892 to your computer and use it in GitHub Desktop.
public List<String> getDataValueFromDataName(String dataname) {
Connection con = null;
List<String> list = new ArrayList<>();
try {
con = open();
PreparedStatement ps = con.prepareStatement(
"SELECT DataValue FROM PDAPI WHERE DataName = ?"
);
ResultSet rs = ps.executeQuery();
while(rs.next()) {
list.add(rs.getString("DataValue"));
}
} catch(Exception e) {
e.printStackTrace();
} finally {
close(con);
}
return list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment