> Hi
> I have assigned a project in which user has to give
> database file/text file or any other ODBC source like
> (Access, Excel, SQL Server or Oracle) in RUN TIME.
> Can any one have any idea?
I don't have an idea what you are talking about. If you mean, you want to use the JDBC-ODBC bridge driver without having a DSN, refer to: http://www.rgagnon.com/javadetails/java-0345.html
connection = DriverManager.getConnection("jdbc:odbc:Driver={SQL Server};Server=Server Name;Database=database name" ,"user","passwd");
Try this I got same problem but on Forum I got answer Without creating DSN U can create connection by this line just change
Driver={SQL Server}
For SQL Server itsd running properly check out for others ie Access , Excel
> connection =
> DriverManager.getConnection("jdbc:odbc:Driver={SQL
> Server};Server=Server Name;Database=database name"
> ,"user","passwd");
>
>
> Try this I got same problem but on Forum I got answer
> Without creating DSN U can create connection by this
> line just change
>Driver={SQL Server}
> SQL Server itsd running properly check out for
> others ie Access , Excel
That isn't sufficient.
The syntax for each source is different.
> connection =
> DriverManager.getConnection("jdbc:odbc:DRIVER=Microsof
> t Access Driver
> (*.mdb);DBQ=d:/data/data.mdb","username",
> "password");
>
>
> For Access u can try this.
You originally posted for SQL server, vaguely mentioning that this works the same way for all others and jschell already pointed out that it isn't sufficient... rightly so. As for what you are mentioning here, it is mentioned in the link posted in reply 1.