Skip to content

Commit

Permalink
Seit MySQL 6 darf COLUMN_PATTERN in meta.getColumns(null,schema,table…
Browse files Browse the repository at this point in the history
  • Loading branch information
willuhn committed Mar 17, 2017
1 parent 1e80763 commit a6c3c2d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/de/willuhn/datasource/db/AbstractDBObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,18 @@ protected void init() throws SQLException
try {

String schema = System.getProperty(getService().getClass().getName() + ".schema",null); // BUGZILLA 960
meta = getConnection().getMetaData().getColumns(null,schema,tableName,null);
try
{
meta = getConnection().getMetaData().getColumns(null,schema,tableName,null);
}
catch (Exception e)
{
Logger.trace("unable to fetch table meta-data using NULL column name pattern, trying '%', see https://bugs.mysql.com/bug.php?id=81105");
meta = getConnection().getMetaData().getColumns(null,schema,tableName,"%");
}
String field;
if (!meta.next())
throw new SQLException("unable to determine meta data for table " + tableName);
throw new SQLException("database table not found: " + tableName);

do
{
Expand Down

0 comments on commit a6c3c2d

Please sign in to comment.