I see there's already a post on something similar but the solution there didn't work for me.
I'm trying to use the MATLAB 2017 database app and MSSQL Enterprise so I can import SQL data into MATLAB using SQL syntax. I tried the Mathworks method by creating the two text files. This didn't work as Matlab could not find the .jar and .dll files.
I then copied these files directly into the Matlab prefdir root and used the add java path and java.lang (see images) to point Matlab towards them. This worked as I know no longer get the cannot find the error. But now I am still getting the "This driver is not configured for ..." error seen in the pic.
SQL is IP/TCP enabled and the correct port number is used.
Any help would be massively appreciated, guys!
database app error matlab screen dump
Related
I am currently training to be an application developer and am in my second month.
Now I got a task that felt impossible for me.
I have also googled since yesterday but did not find anything.
I have to insert the data from a database that I access with SQL Explorer into a .csv file. and save it on my machine
It should work automatically, but for testing it doesn't have to.
I use Eclipse and program with Java, have seen something on the Internet that it works with MySQL, but the DB2 database is connected with the SQL Explorer.
My plan is a solution, programming in java to update everyday the csv thats basically my task
Sorry if it doesn't fit here on Stackoverflow, I'm totally lost because I'm still in the trial period.
Greetings from Germany
IBM Data Server Client and driver types.
The IBM Data Server Driver Package, for example, contains the Command line processor plus utility which can run various db2 commands, statements and scripts including the Db2 EXPORT command.
Usage:
From the OS command line:
clpplus -nw user/password#host:port/database #s1.sql
The contents of the s1.sql file used as a parameter above:
SET ECHO ON;
EXPORT TO "full\path\to\my_file.csv" of del
SELECT *
FROM MYTABLE;
EXIT
You may use whatever valid SELECT statement in the EXPORT command.
I need to export my project
Im using Eclipse and MYSQL. My project is working fine in IDE and my database is already connected.
The problem is that I don't know how/where should i start?
I read things about like making a file contains manifest.mf, exporting project through runnable jar, maven etc. As a result of reading and searching too much of "how to export it", those things made me more confuse and i don't know what should i do anymore.
What i want to do is for someone on other computer can access my application without opening an ide or sql (is it possible?)
So can someone clarify and give me guide how to export your whole project + database in the most simplest way if possible, because im new to this thing.
Use an embedded database and setup the database in the start of your application.
The main contenders in the java space are HSQLDB, H2 and Apache Derby.
If this is not required by your application it will be an extra hurdle, then evaluate the trade off between changing the application to use an embedded database versus setting up a server to be accessed from the other computer.
I've been trying to access a Visual Fox Pro database from Java for a week now. I'm getting desperate because my project is in a very tied budget and timeframe. (As any other project, I guess, hahaha)
I have a .dbf, a .cdx and a .fpt files. I need to be able to look for a record, extract data, and update data. I don't have a VFP licence.
I hope someone has some pointers or a working example that I can use. If the only way is buying a driver I'll be willing to consider it based on suggestions received.
This is a short description of what I have tried.
I found this xBaseJ: java objects to read and write to dBase files. But it doesn't suport CDX index files.
Also found this Example to access a dbf. But my tests show this exception: java.sql.SQLException: [Microsoft][Controlador ODBC dBase] La tabla externa no tiene el formato esperado.
I guess a translation to english of this error could be something like: java.sql.SQLException: [Microsoft][ODBC dBase Driver] External table is not in the expected format
Because of that error I think I need a newer driver. In this microsoft page say they no longer have an ODBC driver, and everybody should use OLE DB Provider. The problem is I haven't found a way to use it from java.
As far as I can tell, there is no way to do it directly. Found here someone talking about a JACOB "thingy", and someone comments about the need to create a C++ or C# "something" to be able to do what I need. I think he is talking about The JACOB Project: A JAva-COM Bridge. But I also don't know what COM calls would actually have to make.
Haven't been able to find a suitable JDBC driver.
Thank you all.
Ely.
I found the way to do it.
I ended up using JACOB (from here <= upd 2021-10-25: now here).
Downloaded and installed Visual FoxPro OLE DB driver from http://msdn.microsoft.com/en-US/vfoxpro/bb190232 (upd 2021-10-25: links there do not work anymore). the direct link is: Microsoft OLE DB Provider for Visual FoxPro 9.0 SP2 (upd 2021-10-25: does not work anymore)
Downloaded JACOB version 1.17 binary and source code.
Added jacob.jar as a Java Build Path library
Copied jacob-1.17-x86.dll to the project directory (same place as eclipse's .project file)
Copied jacob-1.17_src\jacob-1.17\samples\com\jacob\samples\ado contents to my src directory and:
Removed the ms directory
renamed test.java to Main.java
Changed the connection string to:
String connectStr = "Provider=vfpoledb;Data Source=C:\\path\\to\\Data\\;Collating Sequence=general;";
Changed the queryStr to match one of the dbf's name
Hope this helps someone else.
Since the jacob approach did not work anymore as described and others seemed to work without the OLE DB bridge, I cancelled trying there and successfully did it via hxtt.com drivers:
register with some email and the mailed link contains some password to get to the drivers page
there one can download the proper driver, e.g. v42 till Java 8 or v43 since Java 9
use the following JDBC settings in your env (e.g. Eclipse Database Explorer) to access your DBF files (e.g. you have some C:\foo\bar.dbf):
driver jar: e.g. DBF_JDBC42_tillJava8.jar
driver class: com.hxtt.sql.dbf.DBFDriver
URL: jdbc:dbf:/c:/foo/
(if required by your tool with dummy values:)
database: db
user/pass: usr / <empty pass>
You may find interesting to use a jdbc driver for foxpro files.
I made some quick tests with this one, and it almost looks like you are using a real database in Java.
Regards,
I found that Derby database is installed with the jdk automatically. I wanted to use bu I encountered a problem for which I could not find the solution in google.
I have a russian version of windows. Derby seems to be installed correctly, but when i start the database itself or sysinfo - it gives me out some info but in some unknown symbols - actually its a mess in cyrillic symbols instead of plain english. When i try to create a database - it throws an exception so I cant connect, but I cant read the message because of the mess in the symbols.
Has anyone had the same problem?
If I dont find the solution, how can I uninstall Derby from the jdk-release and install it locally into another directory?
You can install derby separately by going to http://db.apache.org/derby and downloading the JAR files and adding it to your project class path. I always do this instead of using the default derby that comes with the JDK.
by the way, if you do this and still get those weird symbols, your problem might be elsewhere. Hope you solve this, derby is a cool embedded db :)
You can also use derby as a filesystem DB. Download from here Then in your code, you need to change driver name and connection string accordingly.
For in memory
driver=org.apache.derby.jdbc.EmbeddedDriver
url=jdbc:derby:memory:myDB;create=true
For fileSystem ,
driver=org.apache.derby.jdbc.ClientDriver
url=jdbc:derby://localhost:1527/schema_name;create=true
I made a little Java application which writes stuff to an Access database.
When I run it in Eclipse, it works just fine, but when i build it using Maven and run it, it fails.
As soon as I try to access the database it gives me the following error:
[Microsoft][ODBC Manager] Data source
name not found and no default driver
specified
I know this is a common error but there are so many vague solutions out there I'm too confused to get it fixed.
I have no User DSN's or System DSN's whatsoever, I also don't have a running SQL server as far as I know.
I have no clue as to what to do next.
Wondering if this could be a bitness issue (assuming the machine is 64bit)?
I suspect that this is more about which Java Runtime Environment) is being used to execute the built application rather than what is used to actually build it...
Microsoft only has a 32bit ODBC driver for Access - so, unless the Java application is being run in a 32bit JRE then I suspect there will be no way it can interface with the 32bit native C portion of the Bridge that, in turn, will load the 32bit ODBC Driver.
Just a thought...
You probably use connect string with relative .mdb filename. You can use full filename:
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\Nwind.mdb