On Tue, Mar 23, 2010 at 01:02, Paluee <[email protected]> wrote:
> So I guess there is no other way than ODBC way.
> I am trying to avoid that. I wish to just write code and not have to
> do any kind of configuring, like setting up a datasource in the
> windows controlPanel/Administrative Tools.
If this is the only reason why you want to avoid ODBC, you can be
helped. An ODBC connection string can be defined also DSN-less. For H2
in particular you might need to test a little. As I know from other
databases - at least for DSN less connections it is important to
specify the parameters also in the correct order as the database
driver wishes.
You need to specify all needed parameters in the connection string and
you must have a "DSN=;..." at the beginning (DSN being empty).
Here is an example for MS SQL Server without the need of configuring a DSN:
ODBC;DSN=;SERVER=localhost;DATABASE=TEST;UID=sa;PWD=nothing;DRIVER={SQL Server}
For H2 it is maybe "ODBC;Data Source=;..." according to
http://www.h2database.com/html/advanced.html#odbc_driver - I did not
try this, so I can't tell you the exact valid string.
--
Martin Wildam
--
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.