aspose file tools*
The moose likes JDBC and the fly likes how to connect to excel database residing on a different machine ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to connect to excel database residing on a different machine ?" Watch "how to connect to excel database residing on a different machine ?" New topic
Author

how to connect to excel database residing on a different machine ?

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hi All,
Can anyone explain me with java code how to connect to a excel database residing on a different(I know that we do it thro' dsn) in my network .
Also, I am doing a website where some pages of website are jsp, servlets. I want to implement a search functionality in my site so that if the user types a keyword then I need to show him the links to the pages(whether jsp,html) which contain this keyword. How do I do that other than using property files .

Thanks for you time and reply,
Kumar.


RR Kumaran
SCJP 1.4
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15292
    
    6

Well, the second half of your question regarding JSP/Servlets would probably be better answered in a seperate forum. There is a forum for JSP and a forum for Servlets. I would suggest posting that part of your question in the JSP forum.
As for your JDBC question, I am going to assume that you mean an Access Database, not an Excel database, since Excel is a spreadsheet application. (Though the underlying funtion is probably the same between Access and Excel). Yes, you typically have to use DNS entries to comunicate with an Access Databse. I have seen Drivers that use a DNSless connection, but it is not supported everywhere.
As far as connecting to an Access Database on a seperate machine, in both cases stated above, you would have to have a physical drive mapped to the PC where the database resides.
Is there any reason you are using Access instead of something like MySQL? I would suggest staying as far away from Access as possible.
BTW - There is a naming policy here at Javaranch. A moderator will probably let you know about it unless you go ahead and change your name to adhere to that policy. Just giving you a heads up.
[ February 15, 2003: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The easiest way is to set up an ODBC connection to the Excel doc and then use the JDBC-ODBC bridge.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I've done this quite happily when the spreadsheet is on the same Windows machine as the JDBC code to use it: Set up a DSN from the control panel, refer to it from the JDBC-ODBC bridge.
But I've never managed to refer to either an Access database or an Excel spreadsheet through JDBC, when the data resides on a different machine. On one where I don't have access to the control panel (such as a shared server), I wouldn't even know where to start.
Can anyone who has done this offer any suggestions or hints if there is something obvious missing here?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
I think you need to set up a system dsn.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to connect to excel database residing on a different machine ?
 
Similar Threads
JSP
Prevent timeout on parent jsp where applet resides
Database connection without creating datasource
JSF database to excel
Deploying EJB on Internet