Hi,

 I found the cause of the problem. the target table
exists in multiple schema. The database I use throws
SQLException when trying to invoke DatabaseMetaData.getColumns
method specifying table name with schema name as follows :

  ResultSet rs = meta.getColumns(null, null, "schema.table1", null);

In addition to that, catalog & schema name is assigned to the
first values which is extracted from DatabaseMetaData(see
TableLink.java line91 / 95).
So, the values of catalog and schema are just unclear.

Is it possible to alter the interface of CREATE LINKED TABLE statement
so that you can specify schema explicitly?



Sincerely,


On Sep 19, 4:38 pm, Toshiaki Takashima <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I want to create Linked Table for Database called 'Symfoware'
> but NullPointerException occurs like below :
>
> <<H2 Log>>
>
> /**/Statement stat3 = conn1.createStatement(1004, 1008);
> 09-19 16:32:31 jdbc:
> /**/stat3.setMaxRows(1000);
> 09-19 16:32:31 jdbc:
> /**/stat3.execute("CREATE LINKED TABLE 
> EMPLOYEE_SYMFO('com.fujitsu.symfoware.jdb
> c.SYMDriver','jdbc:symford://XXX.XXX.XXX.XXX:2051/EFTEST3;schema=SC_EFTEST3­','dev
> user','dev2007','EMPLOYEE')");
> 09-19 16:32:31 jdbc: SESSION_PREPARE_READ_PARAMS 140
> 09-19 16:32:31 jdbc: COMMAND_EXECUTE_UPDATE 140
> 09-19 16:32:32 command: slow query: 281
> 09-19 16:32:32 jdbc: SQLException
> org.h2.jdbc.JdbcSQLException: General error : java.lang.NullPointerException
> General error: java.lang.NullPointerException [50000-78]
>         at org.h2.message.Message.getSQLException(Message.java:103)
>         at org.h2.message.Message.convert(Message.java:257)
>         at org.h2.command.Command.executeUpdate(Command.java:210)
>         at org.h2.server.TcpServerThread.process(TcpServerThread.java:282)
>         at org.h2.server.TcpServerThread.run(TcpServerThread.java:126)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.NullPointerException
>         at org.h2.index.BaseIndex.initBaseIndex(BaseIndex.java:63)
>         at org.h2.index.LinkedIndex.<init>(LinkedIndex.java:34)
>         at org.h2.table.TableLink.addIndex(TableLink.java:233)
>         at org.h2.table.TableLink.connect(TableLink.java:183)
>         at org.h2.table.TableLink.<init>(TableLink.java:64)
>         at org.h2.schema.Schema.createTableLink(Schema.java:470)
>         at 
> org.h2.command.ddl.CreateLinkedTable.update(CreateLinkedTable.java:75
> )
>         at org.h2.command.CommandContainer.update(CommandContainer.java:69)
>         at org.h2.command.Command.executeUpdate(Command.java:205)
>         ... 3 more
>
>         at org.h2.engine.SessionRemote.done(SessionRemote.java:407)
>         at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:190)
>         at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:163)
>         at org.h2.server.web.WebThread.getResult(WebThread.java:1712)
>         at org.h2.server.web.WebThread.query(WebThread.java:1275)
>         at org.h2.server.web.WebThread.process(WebThread.java:442)
>         at org.h2.server.web.WebThread.processRequest(WebThread.java:184)
>         at org.h2.server.web.WebThread.process(WebThread.java:239)
>         at org.h2.server.web.WebThread.run(WebThread.java:194)
>
> Please Tell me what shoud I do for that.
>
> Sincerely,
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to