Java tutorial
//package com.java2s; import java.sql.*; public class Main { public static String QueryVcTable2(Statement stmt, String app_name) { String sql_1 = "SELECT app_versioncode FROM app_info.`msp_table_8.12_copy` WHERE app_name='" + app_name + "'"; ResultSet result = null; String v = null; try { result = stmt.executeQuery(sql_1); while (result.next()) { v = result.getString(1); } if (v != null) return v; } catch (SQLException e) { e.printStackTrace(); } return null; } }