• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you need to set up a system dsn.
 
reply
    Bookmark Topic Watch Topic
  • New Topic