Here you can find the source of loadColumnTableNameList(PreparedStatement stmt)
Parameter | Description |
---|---|
stmt | PreparedStatement |
public static List<String> loadColumnTableNameList(PreparedStatement stmt)
//package com.java2s; import java.sql.PreparedStatement; import java.sql.ResultSetMetaData; import java.util.ArrayList; import java.util.List; public class Main { /**//from w ww. j a va 2 s.c om * Return table name list which is related on columns. * * @param stmt PreparedStatement * @return */ public static List<String> loadColumnTableNameList(PreparedStatement stmt) { List<String> tableNames = new ArrayList<String>(); try { ResultSetMetaData rsMetaData = stmt.getMetaData(); if (rsMetaData != null) { for (int i = 1; i <= rsMetaData.getColumnCount(); i++) { tableNames.add(rsMetaData.getTableName(i)); } } } catch (Exception ignored) { } return tableNames; } }