For what you are trying to do, instead of PreparedStatement
you can use Statement
. Your code may be modified as-
String sql = "SELECT column_name from information_schema.columns where table_name='suppliers';";
Statement s = connection.createStatement();
ResultSet rs = s.executeQuery(sql);
Hope this helps.