Visualizzazione dei risultati da 1 a 9 su 9
  1. #1

    [Java]-jdbc con Ms ACCESS

    Devo rendere un database ACCESS disponibile da una macchina Linux. Devo usare Java per fare questo(tramite jdbc),ma vorrei sapere se conoscete un sito o un manuale on-line che illustri la procedura da seguire o,ancora meglio,mi possiate illustrare voi un metodo per risolvere il mio problema. Grazie.

  2. #2
    Se ho capito bene hai un client Linux ed un server Windows32 con un batabase Access. Se è così dovrebbe essere sufficiente creare un alias che punti al file - database in ODBC del Pannello di Controllo di Win32. Dal client Linux poi è sufficiente puntare alla macchina ed in particolar modo all'Alias che hai creato.

    E' corretto?

    Prova e fammi sapere, Denis.

  3. #3
    Il problema è che devo gestire il tutto con JAVA e JDBC(se possibile). Il programma JAVA che devo fare deve girare su un server Linux e il mio problema è avere informazioni riguardanti la possibilità di gestire un DB ACCESS(già creato) con il JDBC di JAVA.
    In paoche parole: JDBC può gestire un DB ACCESS? o devo portare il DB su MySQL e da li usare il JDBC?.

    Ciao e grazie

  4. #4
    L'interfaccia Java Jdbc non gestisce mai direttamente il file database. Per arrivarvi si usano dei driver appositi oppure un alias. Nel tuo caso, visto che hai già il file, entra in Odbc del pannello di controllo e lì crea una origine dati che punti al tuo file access. Poi in Java con Jdbc richiamerai tale alias per gestire il database.

  5. #5
    il problema appunto è che deve utilizzare un server linux
    e non credo che sul server linux esista la possibilità di "andare nel pannello di controllo e settare l'oridine dati odbc"
    Anche perchè mi pare che gli ODBC siano strettamente windoz

    Pertanto secondo me hai due possibilità: o porti il db in mysql (o postgreSql o quant'altro), oppure utilizzi un server windows
    23-08-2005: Udinese in cémpions lìg
    Questa estate l'ho passata a Tallin

  6. #6
    Si può fare. In Odbc puoi settare un alias come raggiungibile da un client esterno. In Java per raggiungere tale database farai:

    "jdbcdbc://nome_della_macchina:socket(non è detto che sia necessario)/alias"


    Più o meno è così.

  7. #7
    Ok proverò. GRAZIE

  8. #8
    A dire a verità ho fatto delle prove per un programmino che sto scrivendo e non sono riuscito a raggiungere un database *.mdb gestito dall'Odbc di Windows da un computer remoto. Il programma mi funziona soltanto se va in esecuzione sul computer specifico.

    La stringa comunque dovrebbe essere più o meno così:

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    db= java.sql.DriverManager.getConnection(jdbcdbc:database, login, password);

    All'interno della seconda riga si dovrebbe porre l'indirizzo del computer che ospita il database ed il socket su cui tale database lavora.

    Se riesci a capire come si fa dimmelo ok?

    Ciao ciao, Denis.

  9. #9
    Ho trovato sta roba girando in Internet,può essere utile?
    Si dovrebbe gestire tutto come se fosse in rete.Cambia poco rispetto all'uso del jdbc di Java.

    RmiJdbc and Microsoft Access
    RmiJdbc Home Page


    --------------------------------------------------------------------------------
    Connect an MS Access database, using:
    The JDBC/ODBC Bridge (local)
    RmiJdbc and the JDBC/ODBC Bridge (allows remote client/server)
    Or how to make the JDBC/ODBC Bridge become a Type 3 (client/server) JDBC Driver!


    --------------------------------------------------------------------------------

    Setup the ODBC datasource
    You should first install Microsoft Access (of course !), ODBC, the Microsoft Access ODBC Driver, and MS Query to test your ODBC data source: It's all on the Microsoft Office CD-Rom.
    Then, download the sample database file that comes with this demo: rjdemo.mdb (an MS Access DB file - here's a version for office 97 - rename it into "rjdemo.mdb" before use).
    To check everything's right, we suggest you open rjdemo.mdb with MS Access, and query it: select * from contact

    If you still have trouble with Access versions, create the DB yourself:

    Create a new DB
    Create a table named "contact", with two columns: "name" and "email" (character strings)
    Insert a few data
    Save the DB as "rjdemo.mdb", and use it to run the example!
    It works ? Now setup your ODBC data source:


    In the Configuration Panel, double-click ODBC
    Click "System DSN...", then "Add..."
    Choose "Microsoft Access Driver (*.mdb)"
    Type "rjdemo" in the DSN name text box, and browse to select "rjdemo.mdb" as the corresponding database.
    Setup the user name and password in the extended options (in the example, I use "admin" as user name and "rjdemo" as password).
    Then, test your ODBC data source with MS Query; Try the following SQL:
    select * from contact
    If it does not work, your ODBC data source is not properly configured: don't go further until it works fine.


    Make a local test with the JDBC/ODBC Bridge
    Of course, you need a Java Development Kit (JDK 1.1 or later): Download & installation instructions available at Javasoft's JDBC web pages.
    Here's a local example based on the JDBC/ODBC Bridge: compile it (javac localdemo.java) and run it (java localdemo), it should display some data on the screen.
    Don't go further until the local example works: it is necessary to make sure the whole chain, from a java application to MS Access data, is well configured.


    Install and start RmiJdbc
    Download and install RmiJdbc (for example, install it in a C:\RmiJdbc directory).
    Make your CLASSPATH point on RmiJdbc.jar
    (set CLASSPATH=%CLASSPATH%;C:\RmiJdbc\RmiJdbc.jar, or update the CLASSPATH Environment variable in the System part of the Configuration Panel if on Windows NT).
    Start the RmiJdbc server as follows:
    java org.objectweb.rmijdbc.RJJdbcServer
    Network the JDBC/ODBC test with RmiJdbc
    The same example as before, but using RmiJdbc !
    Compile it (javac rjdemo.java) and run it:
    java rjdemo
    Of course, the CLASSPATH needs to point on RmiJdbc.jar, otherwise rjdemo won't find the RmiJdbc classes.
    Note only two lines of code have really changed to make the demo client/server:
    Class.forName("org.objectweb.rmijdbc.Driver").newI nstance(); now registers the RmiJdbc Driver instead of the JDBC/ODBC bridge, and the DriverManager.getConnection(...); first parameter has changed, it has been extended to specify a server host address.



    --------------------------------------------------------------------------------

    Note: the example WON'T RUN if org.objectweb.rmijdbc.RJJdbcServer is not properly launched !!
    You can stop org.objectweb.rmijdbc.RJJdbcServer then start the application to see what happens (an exception is raised and there's no data available), then restart org.objectweb.rmijdbc.RJJdbcServer and restart the application (it should work fine again).

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.