Hi Thomas,
Database version 10-04-2008.
The test below fails with the error. Is it expected behavior or it is
bug in the program?
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Schema name
must match [90080-100]
at org.h2.message.Message.getSQLException(Message.java:103)
at org.h2.message.Message.getSQLException(Message.java:114)
at org.h2.message.Message.getSQLException(Message.java:77)
at org.h2.table.TableLink.readMetaData(TableLink.java:98)
at org.h2.table.TableLink.connect(TableLink.java:82)
at org.h2.table.TableLink.<init>(TableLink.java:65)
at org.h2.schema.Schema.createTableLink(Schema.java:470)
at org.h2.command.ddl.CreateLinkedTable.update(CreateLinkedTable.java:
78)
at org.h2.command.CommandContainer.update(CommandContainer.java:69)
at org.h2.command.Command.executeUpdate(Command.java:206)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:163)
at org.h2.samples.Test.main(Test.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:
90)
public static void main(String[] args) throws SQLException,
ClassNotFoundException {
Class.forName(Driver.class.getName());
Connection ca = DriverManager.getConnection("jdbc:h2:mem:one",
"linkuser", "linkpass");
Statement sa = ca.createStatement();
sa.execute("CREATE SCHEMA Y");
sa.execute("CREATE TABLE A( C INT)");
sa.execute("CREATE TABLE Y.A (C INT)");
Connection cb =
DriverManager.getConnection("jdbc:h2:mem:two");
Statement sb = cb.createStatement();
sb.execute("CREATE LINKED TABLE one('org.h2.Driver',
'jdbc:h2:mem:one', 'linkuser', 'linkpass', 'Y.A');"); //OK
sb.execute("CREATE LINKED TABLE two('org.h2.Driver',
'jdbc:h2:mem:one', 'linkuser', 'linkpass', 'A');"); //FAILS
ca.close();
cb.close();
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---