Reading a FoxPro 2.6 data with Java - java

I'm trying to read a FoxPro 2.6 database using java to retrieve data from an older FoxPro based application to format the output better. I've tried using JavaDBF and xBaseJ with no success. Is there a common way to connect that would allow me to get this information into my Java application?

It's been a long time since I connected to a FoxPro database from a Java application but this is what I remember having to do:
I installed the FoxPro ODBC driver.
Setup as Windows System DSN for the FoxPro ODBC driver.
Then used the JDBC-ODBC bridge to connect to the FoxPro database.

You can try JDBF: https://github.com/iryndin/jdbf
It works without ODBC, with DbfRecord class, you can read DBF file record by record.
When I created it the intent was to have ability to read/write DBFs on Linux boxes, since you have no ODBC drivers on Linux.
Recently support of MEMO fields was added by request of JDBF user. You can send you own requests, and I'll consider it for implementation.

Related

How to download and install IBM AS/400 database on window?

My requirement is to download and install db2/400 database on windows but I am unable to find the download option which can install db2/400 database on my window laptop. I can find drivers to connect with the db2/400 database but please help me get db2/400 database to be downloaded?
It will be very helpful if I can get a freeware/trial version/sand-box env or a free virtual image of db2/400?
Edited:
I found this link: IBM Db2 for i. It has an option to download for windows 64-bit machine.
Is that what I am looking for?
No way.
There are no working IBM i emulators on x86 at the moment.
The original question has already been answered , in that at present there are no working free emulators for IBM-i for x86 architectures. But the question did not explain the real end goal.
The motiviation behind the question appears to be a request for a driver to access the i-series via jdbc without needing to purchase additional IBM licenses.
That requirement may be met by the open source jt400 driver available at http://jt400.sourceforge.net/
Additional clarification is that while the jt400 jdbc driver lets you access i-series database, it is not for accessing Db2-LUW databases (e.g. on MS-Windows). To access Db2-LUW databases you need the (cost free) IBM jdbc drivers. Other jdbc drivers are also available from third parties, with different requirements for licensing.
For additional awareness, you need to know that the SQL used for accessing i-series database can be different from the SQL used to access either Db2-LUW databases or Db2-for-Z/OS databases. It's possible to use standard SQL that will work on all variants of Db2 but you will then be unable to harness the additional platform-specific power offered by each Db2-variant to properly exploit the platform.
If you want to use a single jdbc driver that can connect to any of Db2-LUW or Db2-for-iseries, or Db2-for-Z/OS then you can use an IBM-supplied driver. With that IBM driver for accessing either i-series or z/os then you must either supply a license file, (i.e. purchase the license) or use a pre-existing Db2-connect-gateway at your site (which is separately licensed and does not require per-workstation licensing). You don't need licenses just for connecting to Db2-LUW databases.

How to export a java project with a database ( connected to sql server ) for using in different computers?

I'm new in working with databases and connecting java to sql server. I just created a database and a java application for it. I used the sqljdbc4.jar file in my library and all the stuff required to connect the app with the database, but I want to know : what do I need to export so someone in an other computer can use that application and have that database in that computer, without having installed sql server or something, what do I need to do ?
It depends on what you want to do. If you want them to connect to a databse via your app, then you will have to allow them to access the database via your application by providing the privileges. If you want to bundle the whole database with your java code, then you need to use an in application database like h2 http://www.h2database.com/html/main.html. There are alternatives like derby and hsql db, but h2 is better than that. See the comparison on the h2 homepage.

how to configure a database drivers in java automatically

I have created a java desktop application where I use MS Access as back end. I configured the ODBC drivers manually by clicking on control panel>administrative tools>ODBC Data sources and by selecting the drivers and database. It's working fine as I run it on Netbeans IDE
I am using Install Creator to make an .exe file. if I do so how and where should I place the database inside the installer and how to configure the ODBC drivers automatically when I install the software in another system.
You don't need to create a DSN (Data Source Name) to use an ODBC Driver. You can use a) FILEDSN or b) DSN-less connections. File DSNs are where you put the attribute and value pairs which describe the database connection in a file and pass FILEDSN=c:\path_to_file in SQLDriverConnect. DSN-less connections are where you pass all the attribute/value pairs required to SQLDriverConnect and it must contain a DRIVER={whatever the driver is called}.

Deploy Java Desktop Application with MS Access DB

This is the first time I am going to deploy the Java Desktop Application with MS Access DB and discovered JAR package is not getting database access other then my development PC though I had the MS access DB in the same directory of the JAR file I have copied after Build the application. And I understand that I cannot connect MS access DB I created with ODBC connection of my PC. Now my question is
How can I deploy Java Desktop Application with MS access BD which will run in any computer where manual ODBC connection to the MS ACCESS DB for every computer will not require ?
I am not trying to connect MS access DB within a net work rather I am trying run this app where MS Access DB is already installed and my supplied DB will be with the JAR file and I want to access the DB I have provided from Java Front End Application.
Please help.
First you should get ODBC driver for Access database. Some computers may don't have it.
After you install that driver you should create ODBC Data Source on computer. I have no idea how to do it in Java, but ODBC Data Source configurations are stored in registry and you can add your Data Source.
Google "registry add odbc data source" or "Can I Create and Delete a DSN Using a Script" (second one is title of good article i found.
Probably you can access registry from java without any problems.
You can also use one of install-maker programs. Some of them have something like "Add Data Source" functionality.

a desktop application storing data?

Say I have created a desktop application in Java to keep notes. I used MySQL for storage. On my computer it connects to database I have created(using my root username and password). But what if I want to distribute my program? Are the other users should have MySQL installed on their system? If they have to isnt tat a problem that I have my MySQL username and password embedded in code?
In general, I am asking how can I make a desktop program in Java which can store data from its users??
Sounds like you want SQLite, There is another SO question here about it.
SQLite as IanNorton mentioned is a good alternative. Other good alternatives are Apache Derby or the H2 database, both providing an embedded (install-free) java database.
Does MySQL have its own embedded version?
Normal "embedded MySQL" is a native code library (libmysqld) that is not really suitable for use with Java. However, there is something called mysql-je that purports to be a Java compatible wrapper. The problem is that it is based on a rather old version of MySQL, and hasn't been updated since 2006.
There are also postings on the MySQL forums about using embedded MySQL with Java, but there's no sign that it is supported.
So I think you'd be better of going with a one of the alternatives; e.g. SQLite, Derby or H2.
No need of multiple installations of MYSQL database if all the machines where you want to access are in a LAN. In that case you can have single database installation and access it from multiple systems using the IP address of the database machine. We can access a remote database through Internet as well, using the IP Address of the machine in which database exists..

Categories