This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest way is to set up an ODBC connection to the Excel doc and then use the JDBC-ODBC bridge.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to set up a system dsn.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic