Is there a way to speed up getConnection() ?

Hi all,

I don't know much about the java.sql package, and I just have a generic connection to an Excel workbook:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection connection = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};" +

"DBQ="+address+";DriverID=22;READONLY=false","","");

// This is actually in a method, the connection is actually declared outside of it.

For some reason, the connection to the worksheet is very slow. Just a general question on this, is there anything I can do to make it faster? I've done some research and it doesn't look like I did anything wrong, so I'm kind of stumped. It takes something like 30 seconds just to connect, and I think that's making my Statements and PreparedStatements slow down too. Any help on this would be great.

Thanks!

Jezzica85

Message was edited by:

jezzica85

Message was edited by:

jezzica85

[1155 byte] By [jezzica85a] at [2007-11-27 4:56:33]
# 1
first step would be to realise that Excel isn't a database.second step would be to realise that the bridge driver isn't a very good driver (not just because of its poor performance).
jwentinga at 2007-7-12 10:11:46 > top of Java-index,Java Essentials,Java Programming...
# 2

Thank you jwenting,

I know Excel isn't a database, but I was under the impression that you can connect to a workbook using JDBC. I already know with my program that it does connect, so that's not exactly the problem.

The only driver I know if is the bridge driver. Is there another one you can recommend, or a way to speed up the connection with the JDBC?

Thanks,

Jezzica85

jezzica85a at 2007-7-12 10:11:46 > top of Java-index,Java Essentials,Java Programming...
# 3
hiIf you try to convert the exile file to .DBF format it might help to improve your application performance little bit.Sandy
sandysharma2000a at 2007-7-12 10:11:46 > top of Java-index,Java Essentials,Java Programming...
# 4
Really? I've never heard of that file format. What is it and how does Java read it? Could you give me a code example please?Thanks,Jezzica85
jezzica85a at 2007-7-12 10:11:46 > top of Java-index,Java Essentials,Java Programming...