How to create JDBC datasource and access database file dynamically or programmatically
I m writing one application and want to make it opensource. My app uses access database, and i created manually the datasource using run->odbcad32. When I post that app in site , those who download need to run it without much efforts, and they should not need to create access file and data source.,
开发者_C百科1.how can i create the ms access file programatically?
2.how can i create the datasource programatically?
any other ideas to do the same?
Write a batch (*.bat) that start odbcad32.exe and your application.
This sort of thing can be set outside of the application in a config file, not so different from how Spring does it. You can even give them a small gui to set this sort of thing in your application as well, either in the options or even when the application starts up for the first time.
It may make more sense to allow users of your application to pass in the data source.
精彩评论