Re: Create Access databases programmatically via JDBC-ODBC?
From: Bjorn Abelli (DoNotSpam.bjorn_abelli_at_hotmail.com)
Date: 02/05/04
- Next message: briggen: "JDBC sql error"
- Previous message: Bjorn Abelli: "Re: What java.sql.Types datatype should be use for oracle TO_NUMBER function?"
- In reply to: Jonathan Fisher: "Create Access databases programmatically via JDBC-ODBC?"
- Next in thread: Jonathan Fisher: "Re: Create Access databases programmatically via JDBC-ODBC?"
- Reply: Jonathan Fisher: "Re: Create Access databases programmatically via JDBC-ODBC?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 5 Feb 2004 14:06:54 +0100
"Jonathan Fisher" ...
> I am interacting with Access through a JDBC-ODBC
> bridge, and my code needs to create new Access
> databases frequently. Is there some way to
> create a database programmatically from Java,
> instead of forcing my users to invoke the Data
> Source Adminstrator to create a DSN each time?
> I'm hoping for something like SQLConfigDataSource(),
> but without having to muck about in C.
There are several ways to do this, but I think the easiest would be to
deliver an empty "template" database with your application. When the need to
create a "new" db occurs, you simply make a copy of it to the desired
location and with an approriate name.
> Also, once I create a database, how do I create
> new tables in it? Obvious things like
> "CREATE TABLE ... " don't seem to work.
Yes it does.
You maybe have problems with what column types you're trying to use?
All of the types from SQL-92 can be used (except DECIMAL), though some of
the types might not map to what you expect...
// Bjorn A
- Next message: briggen: "JDBC sql error"
- Previous message: Bjorn Abelli: "Re: What java.sql.Types datatype should be use for oracle TO_NUMBER function?"
- In reply to: Jonathan Fisher: "Create Access databases programmatically via JDBC-ODBC?"
- Next in thread: Jonathan Fisher: "Re: Create Access databases programmatically via JDBC-ODBC?"
- Reply: Jonathan Fisher: "Re: Create Access databases programmatically via JDBC-ODBC?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|