Change DB's path

Hello!

If I install ODBC driver on my Win XP for *.xls (Excel file) is there any way to connect to the database per JDBC-ODBC bridge and change the path name of the database (*.xls file) ? I have to make an appliaction that reads excel tables and changes some values. But the file excel file could be anywhere. I'd like that the user must install an ODBC driver only first time, then the application would set the path to proper value each time user uses the application and sets the path of the excel file.

Thanks for future answers and suggestions!

Tilen

[582 byte] By [Funky_1321a] at [2007-11-15]
# 1
Please search for dynamic DSN on this forum. This the answer to your question and has been discussed many, many times on this forum.
cotton.ma at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Oh thanks for the hint and such a fast reply!Tilen
Funky_1321a at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
PS Excel is not a database. If at all possible I would migrate to at least Access which is a database. If you are stuck with Excel I would recommend not using JDBC anyway use something like JExcel.
cotton.ma at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
Yeah I'm stuck on Excel. The excel file is actually a price list of a company that needs this application. And in this price list only prices needs to be updated from another file. So I'll use JExcel.Thanks!
Funky_1321a at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

> Yeah I'm stuck on Excel. The excel file is actually a

> price list of a company that needs this application.

> And in this price list only prices needs to be

> updated from another file. So I'll use JExcel.

>

> Thanks!

Okay glad to help.

The reason I recommend not using Excel for JDBC (which I am writing as much for future readers of this thread as for you) is that Excel ODBC access is so clunky and Excel specific that all the advantages of JDBC are wiped out. Namely your code is totally non-portable to another data source.

Plus it's just a big PITA.

So all in all Excel specific API's are better.

cotton.ma at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 6
JExcel isn't free. I tried with apache jakarta PIO project solution. It's free and awesome. So I solved the prob I had in the morning :).Tilen
Funky_1321a at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...