LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-25-2009, 12:06 PM   #1
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
OpenOffice 3.0.1, JDBC, MySQL and Base


Has anyone successfully gotten OpenOffice 3.0.1 connected to an existing MySQL data base (and, gee, how'd you do it)? This is a full installation of Slackware 12.2 (with all the patches applied).

I have installed mysql-connector-java-5.1.7-bin.jar and it reports that it loads successfully, the CLASSPATH environment variable is set, the data base exists and I can access it and do whatever I want with the command line interface. I've read everything I can find about OpenOffice, MySQL and Base and followed step-by-step with not luck.

Any hints?
 
Old 02-26-2009, 05:30 AM   #2
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Linux Mint 19.1
Posts: 99

Rep: Reputation: 16
I didn't have much luck with the jdbc driver either. I installed the ODBC driver instead and that works without a problem.
 
Old 02-26-2009, 08:38 AM   #3
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
Thanks for the information -- so, I went to http://www.slacky.eu, got the package, built and installed it and... uh, I'm a little lost (even after reading all the unixodbc stuff). I'd appreciate a little nudge in the right direction if you could, with thanks.
 
Old 02-26-2009, 09:37 AM   #4
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Linux Mint 19.1
Posts: 99

Rep: Reputation: 16
There's a configuration file somewhere in /etc/ that you have to modify. That file should contain the information for connecting to the database. I'm not sure what the file is called. I don't have access to my own linux computer at the moment, so I can't look it up. When I get home this evening I will have a look and post some more information here.
 
Old 02-26-2009, 02:56 PM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
If you can, I'd really appreciate seeing what your /etc/odbc.ini and /etc/odbcinst.ini files look like; trying to follow the MySQL documentation and the unixODBC documentation has gotten me, pretty much, completely confused. I have installed mysql-connector-odbc-3.51.27-linux-x86-32bit.tar.gz so the MySQL libraries are there but after that I'm lost. Thanks again for your help.
 
Old 02-27-2009, 04:17 AM   #6
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.2 (multilib)
Posts: 1,259

Rep: Reputation: 60
Not sure if this is at all relevant. I have done some programming using java to access the MySql database. All it involves is having the mysql-connector.jar file in jre/lib/ext. Never tried OpenOffice with it though
 
Old 02-27-2009, 02:00 PM   #7
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Linux Mint 19.1
Posts: 99

Rep: Reputation: 16
Hi.
I'm a bit later with my response then I said I would be, but I was rather busy yesterday. But here it is:

My odbcinst.ini is entirely empty.
My odbc.ini contains the following:
Code:
[ODBC Data Sources]
odbcname     = MyODBC 3.51 Driver DSN

[DatabaseName]
Driver       = /usr/lib/odbc/libmyodbc.so
Description  = MyODBC 3.51 Driver DSN
SERVER       = 192.168.1.100
PORT         = 3306
USER         = dbusername
Password     = dbpassword
Database     = dbname
OPTION       = 3
SOCKET       =
change dbusername, dbpassword, dbname in your mysql username, password and database you want to connect to.

@arubin
I gave your hint a try, but it still doesn't work with the jdbc driver. The driver does load according OOo, but when I try to test the connection I get an SQL syntax error.
 
Old 02-27-2009, 02:48 PM   #8
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
There is a configuration tool called ODBCConfig included with unixODBC.

Brian
 
Old 02-27-2009, 03:32 PM   #9
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
Hi, Broxtor,

Thank you for the listing of odbc.ini; that goes a ways toward figuring out just what's what with this software (never messed with ODBC before).

By the way, the ODBCConfig utility will not work with Slackware 12.2 and qt-3.3.8b-i486-2 (the 12.2 distribution version); the files odbcinstQ.exp and SQLManageDataSources.cpp in the odbcinstQ directory in version unixodbc-2.2.14-i486-1 (the current version) must be edited or replaced with new ones (this per Nick Gorham, the developer) and the package rebuilt. I did this with src2pkg and the ODBCConfig utility now works (it was reporting /usr/lib/libodbcinstQ.so: undefined symbol ODBCManageDataSources).

The changes, are (odbcinstQ.exp)
Code:
QTSQLManageDataSources
QTSQLCreateDataSources
ODBCManageDataSources
ODBCCreateDataSource
and (SQLManageDataSources.cpp)
Code:
/**************************************************
 * SQLManageDataSources
 *
 **************************************************
 *
 * This library should only be used by odbcinst!
 *
 * This code was created by Peter Harvey @ CodeByDesign.
 * Released under LGPL 26.OCT.01
 *
 * Contributions from...
 * -----------------------------------------------
 * Peter Harvey		- pharvey@codebydesign.com
 * Nick Gorham      - nick@easysoft.com
 **************************************************/

#include <odbcinstext.h>

#ifdef QT_V4LAYOUT
#define QT3_SUPPORT
#include <Qt/qdir.h>
#include <Qt/qwidget.h>
#include <Qt/qnamespace.h>
#else
#include <qdir.h>
#include <qwidget.h>
#if QT_VERSION<300
#include <qnamespace.h>
#endif
#endif

#include "CODBCConfig.h"
#include "CODBCCreate.h"

static BOOL SQLManage( HWND hWnd )
{
    //
    // This will allow us to call this from a non QT app
    // 
    if ( !qApp )
    {
        int argc = 1;
        char *argv[] = { "odbcinstQ", NULL };

        static QApplication a( argc, argv );
    }

    QWidget *pwidget = (QWidget*)hWnd;

#if QT_VERSION<300
	CODBCConfig odbcconfig( pwidget, "ODBCConfig", Qt::WType_Modal );
#else
	CODBCConfig odbcconfig( pwidget, "ODBCConfig", Qt::WType_Dialog | Qt::WShowModal );
#endif
	odbcconfig.exec();

    return true;
}

static BOOL SQLCreate( HWND hWnd, LPCSTR dsn )
{
    //
    // This will allow us to call this from a non QT app
    // 
    if ( !qApp )
    {
        int argc = 1;
        char *argv[] = { "odbcinstQ", NULL };

        static QApplication a( argc, argv );
    }

    QWidget *pwidget = (QWidget*)hWnd;

#if QT_VERSION<300
	CODBCCreate odbccreate( pwidget, "ODBCCreate" );
#else
	CODBCCreate odbccreate( pwidget, "ODBCCreate" );
#endif
	odbccreate.setDsn( dsn );
	
	odbccreate.exec();

    return odbccreate.getRetCode();
}


#ifdef __cplusplus
extern "C" {
#endif

BOOL QTSQLManageDataSources( HWND hWnd )
{
    return SQLManage( hWnd );
}

BOOL QTSQLCreateDataSources( HWND hWnd, LPCSTR lpszDS )
{
    return SQLCreate( hWnd, lpszDS );
}

BOOL ODBCManageDataSources( HWND hWnd )
{
    return SQLManage( hWnd );
}

BOOL ODBCCreateDataSource( HWND hWnd, LPCSTR lpszDS )
{
    return SQLCreate( hWnd, lpszDS );
}

#ifdef __cplusplus
};
#endif
I believe that Nick will make the corrections to the release soon.

Thanks again!

Thomas
 
Old 02-28-2009, 03:31 PM   #10
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.2 (multilib)
Posts: 1,259

Rep: Reputation: 60
Well I have now got home to my PC and successfully connected with OpenOffice Base to a MySql database without touching any ini file
 
Old 02-28-2009, 03:38 PM   #11
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.2 (multilib)
Posts: 1,259

Rep: Reputation: 60
Step by step procedure using the database wizard:

Choose connect to an existing database

Select MySql

Next.

Select using JDBC
Next

Enter name of database
For server URL enter a space
Next

Enter username. Tick password required

Next

Choose whatever
Finish

Enter the password I use for MySql
 
Old 02-28-2009, 05:33 PM   #12
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
Thank you for the information; however, well, it doesn't work (it fails with "communications link failure") though I can connect with ODBC drivers with no problem.

I'm using mysql-connector-java-5.1.7-bin.jar with openoffice.org-3.0.1_en_US-i586-1_rlw (the one from Robby Workman).

I have tried localhost, a space, the address, "me"@localhost and every combination of ingredients I can think of with the same result. Sigh.

Thanks for your help.
 
Old 02-28-2009, 06:53 PM   #13
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.2 (multilib)
Posts: 1,259

Rep: Reputation: 60
My set up is Slackware Open Office from slackbuilds with jdk-6u11-i586-1.tgz off slackware extras installed and mysql-connector-java-3.1.12-bin.jar in lib/ext/ (not /jre/lib/ext as I wrote earlier. I don't know if that makes a diiference)
 
Old 02-28-2009, 06:57 PM   #14
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.2 (multilib)
Posts: 1,259

Rep: Reputation: 60
Indeed it does make a difference. The connector must be in /usr/lib/java/lib/ext, not as previously stated
 
Old 02-28-2009, 07:21 PM   #15
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.2 (multilib)
Posts: 1,259

Rep: Reputation: 60
I have just written a short java program which should test whether your java mysql connection is working. I can email it to you if you want.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenOffice Base & MySQL datadriven Slackware 3 06-22-2005 07:37 PM
Openoffice Base 2 beta. How to use MySQL KR-data Linux - Software 1 04-24-2005 01:45 PM
JDBC and MySQL Driver White R4bbit Debian 2 08-13-2004 05:55 PM
mysql and jdbc gballsch Programming 7 05-14-2003 05:04 PM
MySQL and JDBC oulevon Programming 1 07-16-2001 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration