Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix case-sensitive table names issue
  • Loading branch information
genywind committed Mar 6, 2011
1 parent a6fc130 commit 2447ab3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/com/rhomobile/hsqldata/HsqlData.java
Expand Up @@ -139,12 +139,21 @@ private static void copyTable(String strTable, Connection sqliteConn, Connection
private static void copyAllTables(Connection sqliteConn, Connection hsqlConn) throws Exception
{
Statement sqliteStat = sqliteConn.createStatement();
ResultSet rsTables = sqliteStat.executeQuery("SELECT name FROM sqlite_master WHERE type='table' ");
ResultSet rsTables = sqliteStat.executeQuery("SELECT * FROM sqlite_master WHERE type='table' ");

while (rsTables.next())
{
String strTable = rsTables.getString("name");
String strSql = rsTables.getString("sql");

int nPos = strSql.indexOf(strTable);
if ( nPos > 0 )
{
if ( strSql.charAt(nPos-1) == '\"' )
{
strTable = "\"" + strTable + "\"";
}
}
copyTable(strTable, sqliteConn, hsqlConn);
}

Expand Down

0 comments on commit 2447ab3

Please sign in to comment.