Creating DSN from Java
1 posts in topic
Flat View  Flat View

Posted By:   KVN_SUDHEER
Posted On:   Monday, June 25, 2001 05:11 AM

Can i create a DSN(data source name) from a java program, means i don't want to create manually.

Re: Creating DSN from Java

Posted By:   Geert_Vancompernolle  
Posted On:   Thursday, June 28, 2001 12:54 PM


Yes you can. For instance, to connect to a MS Access database, you can use the following statement:

String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\JdbcDatabase.mdb";

The .mdb file has to be there (empty if you want), but you don't have to execute the annoying DNS registration procedure via 'Control Panel | ODBC...' and so on.

I don't know yet how to create the .mdb file from within Java too, but I think it's already an answer to your question.



About | Sitemap | Contact