Is it possible to connect to the H2 database from SQL server database

1,086 views
Skip to first unread message

gabjos

unread,
Aug 20, 2010, 5:08:52 PM8/20/10
to H2 Database
Hi I have a client that wants to connect or pull data via a connection
from their SQL server database to their H2 database. Is that possible?
If so how would I do this?

Dario Fassi

unread,
Aug 20, 2010, 6:36:59 PM8/20/10
to h2-da...@googlegroups.com
Hi,
Driven from MsSQL to H2 it's possible but not so simple, you must use a DTS or Linked Servers (http://technet.microsoft.com/en-us/library/cc917710.aspx).
It's far more simple the reverse other way from H2 use MsSql data, using H2 linked tables in something like:

CREATE LINKED TABLE IF NOT EXISTS MYLINKEDTABLE('com.microsoft.sqlserver.jdbc.SQLServerDriver', 'jdbc:sqlserver://hostname:1433', 'username', 'userpasswd', 'REMOTE_TABLE_NAME') READONLY;
INSERT INTO SOME_LOCAL_H2_TABLE ( select * from MYLINKEDTABLE );

Sql server's jdbc driver must to be in the classpath of H2.

regards,
Dario

El 20/08/10 18:08, gabjos escribió:

gabjos

unread,
Aug 23, 2010, 4:08:57 PM8/23/10
to H2 Database
What should I select for the provider name?
> > If so how would I do this?- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages