SQlite in NetBeans - sqlite

hi I am trying to add sqlite driver into my netbeans 6.9.1 project, these are the steps that I have done :
adding the the sqlitejdbc-v056.jar into the the libraries of my project
in "services" tab in netbeans, creating a driver with a name of "SQLite" ,adding the driverfile and finding the driver class (org.sqlite.JDBC) for the Driver.
now by right clicking on the driver and selecting "Connect Using", I have to add a JDBC URL connection for this driver, but any kind of URL that I add I keep getting this message :
Unable to add connection. cannot establish a connection to jdbc:sqlite:/ using org.sqlite.JDBC -unable to find a suitable driver-.
please let me know how to create this connection for a simple database.
thanks

If you are working on windows, change all backslashes to slashes in your path. This one I'm using right now:
jdbc:sqlite://T:/data/sampledb.sqlite

Related

HFSQL connect to initial catalog

I have already running a project in production.
And .wdd is missing. I can't use server/client, for it.
Can I create .wdd file? Or connect to catalog without it?
I using pypyodbc and python3 for it
Only way to find wdd file is in the WinDev project directory.
But also if you don't have the project, you could connect to DB via ODBC using ODBC driver for HFSQL. With that you only have to connect to ODBC and the HFSQL driver do the rest.
https://help.windev.com/en-US/?3044179

FoxPro ODBC Table not found

The FoxPro ODBC on my machine is only able to connect to certain tables in the ODBC Connection. When I try to connect to specific tables in the same connection I receive the error [Microsoft][ODBC Visual FoxPro Driver]Not a table.( #123). However, I am successfully connected to other tables without an issue. I know these tables I am unable to connect to aren't corrupted because I am able to view the data in them using Visual Fox Pro.
Any suggestions would be appreciated.
First I'd use the Visual FoxPro OLEDB driver instead of ODBC. It's faster and more fully featured.
Then check whether the TableValidate setting is affecting it. To check that, back up the data then open the table exclusively in Visual FoxPro and issue the following in the command window:
append blank
go bottom
delete
pack
This will append and then delete a blank record, forcing the header counters to be recalculated. Then try it via the connection.
Also try turning tablevalidate off for the OLE DB driver as follows.
Create a text file called CONFIG.FPW in the same location as vfpoledb.dll, on a 64-bit machine this will be in 'C:\Program Files (x86)\Common Files\System\Ole DB'.
In the text file just put one line:
TABLEVALIDATE=0
And retry.
First: Do not use ODBC driver UNLESS your tables are VFP6 and earlier compatible. The last ODBC driver released was only for 6 and earlier. If you still need to use ODBC then check Sybase ADS driver. It is compatible with later versions too and local mode is for free.les
Second:Be sure that the tables you are trying to open are really not corrupted (not a table error is often occurs when the header info is off by pne record = you can check the details on "Not A table" entry on foxwikis. You might be looking into two different files when you check from VFP and through OLEDB driver. You can specify the fullpath to be sure.

Birt report designer

I tried to establish one connection between BIRT and Oracle but it's not working.
I received this error message :
First download an oracle JDBC driver from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
take the .jar e.g. called ojdbc8.jar.
Then use use Manage Divers... menu and add the just downloaded .jar. This will add new entries to the driver dropdown menu. Now select the Oracle driver entry from the menu e.g. oracle.jdbc.driver.OracleDriver (v12.2)

How can I specify a RELATIVE JDBC SQLite url (path?)

I've been trying to get this work for two days and tried all suggestions that I could find. Alas, without success, so far.
This is what I'm trying to do: I am building a small (java swing) desktop database application. I'm using Netbeans 7.0 and SQLite, and found the JDBC driver from http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC to work fine as long as I specify an absolute path in the JDBC URL:
jdbc:sqlite://Users.../lib/db/ithildin.db
Here's how it looks in Netbeans' Services -> Databases tab, using an absolute URL:
opening the connection and then the tables node shows the available tables.
But because I intend to distribute this application to other people, using an absolute path is not going to work. From what I have read here and there it seems to be possible to also specify a relative path to the SQLite database file, but I cannot get it to work whatever I try.
The strange thing is that when I create a connection in Netbeans it initially seems to work when I put both the sqlite jdbc driver jar and the sqlite database file in a /db subdirectory in /lib (in the Netbeans project directory):
and when I open the new connection it maintains that illusion -
but when I open the "Tables" node it turns out to be empty:
Similary, this connection seems valid but as soon as I try to use it - for instance in "Generating Entity Classes From Database" it tells me that there aren't any tables in that database.
Does anyone know a way out of this? I'd much appreciate it.
Lúthien
I've followed the same steps that you have and my findings suggest that the relative path in the New Connection Wizard is relative to NetBeans' working directory which is the directory that NetBeans is installed to.
For example, in your connection string you are "connecting" to a database that resides at <NetBeans-Install-Dir>/ithildin-13-11-11.db. Since this database does not exist, SQLite is creating it for you which is giving you the "illusion" that you are seeing. In my tests, the database that I was trying to connect to with a relative path was created in the NetBeans install directory.
In other words, everything is working as designed.
In your code you can use a relative path and it should be relative to the top of your project's directory. In NetBeans' Databases Service you will need to either use an absolute path to connect to the database that exists (in your project) or you will need to provide a relative path that begins at NetBeans' install directory.
My suggestion is that you use a relative path in your code and an absolute path in the New Connection Wizard.

How to make a database service in Netbeans 6.5 to connect to SQLite databases?

I use Netbeans IDE (6.5) and I have a SQLite 2.x database. I installed a JDBC SQLite driver from zentus.com and added a new driver in Nebeans services panel. Then tried to connect to my database file from Services > Databases using this URL for my database:
jdbc:sqlite:/home/farzad/netbeans/myproject/mydb.sqlite
but it fails to connect. I get this exception:
org.netbeans.modules.db.dataview.meta.DBException: Unable to Connect to database : DatabaseConnection[name='jdbc:sqlite://home/farzad/netbeans/myproject/mydb.sqlite [ on session]']
at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.initialDataLoad(SQLExecutionHelper.java:103)
at org.netbeans.modules.db.dataview.output.DataView.create(DataView.java:101)
at org.netbeans.modules.db.dataview.api.DataView.create(DataView.java:71)
at org.netbeans.modules.db.sql.execute.SQLExecuteHelper.execute(SQLExecuteHelper.java:105)
at org.netbeans.modules.db.sql.loader.SQLEditorSupport$SQLExecutor.run(SQLEditorSupport.java:480)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
What should I do? :(
The current version of Zentus SQLiteJDBC is v053, based on SQLite 3.6.1. It will not open a 2.x SQLite database. Perhaps you can use SQLite 2.x command line tool to .dump your database, and the Sqlite3 command line tool to .load it. The use Zentus SQLiteJDBC to access the new SQLite 3.x database.
Alternatively, use a JDBC driver that supports SQLite 2 such as this one.
It's againg me...
I have made two mistakes during my first attempt. After setting CLASSPATH as a system variable (hope I didn’t broke smth else :)), putting sqlite_jni.dll to the system32 folder and correcting JDBC url I have got a success :)
I also have downloaded their SQLite ODBC wrapper. Installed it and made a connection to my SQLite2 database via ordinary and UTF8 based ODBC driver. I also used built in NetBeans JDBC-ODBC Bridge driver to be able to set up this connection.
All three connections have been created but:
ordinary ODBC driver: I see text data in a wrong encoding. All other columns are displayed correctly
UTF8 ODBC driver: I don’t see text data at all. All other columns are displayed correctly
JDBC driver: I don’t see any column at all. "Select * from my_any_table" always returns an empty single column
I have Russian based data in my database.
So...currently I have returned to sqlite command line interface :))

Resources