• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Connection to MySQL-DB under LibreOffice and Linux Mint

 
Heinrich Stoellinger
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have been using a JDBC-connection to a remote MySQL-Database for years. There is one rather problem, however:
I have a table with the name "inventar" (German for "inventory"). I can access this table using a command-line client
(mysql ...) as well as using the "native" MySQL connector, which can be defined as an extension to LibreOffice and
OpenOffice. However, when using JDBC, the table content is NOT displayed at all. All the other (some 80 in number)
are accessible through JDBC without problems. There are 1316 tuples ("records") in the table.
I wonder what's the problem...
Below is the table definition:
DROP TABLE IF EXISTS inventar;
CREATE TABLE inventar
(nummer INTEGER NOT NULL,
bezeichnung VARCHAR (255) not null default ' ',
stueckZahl INTEGER not null default 1,
anschDatum DATE not null DEFAULT '1999-09-01',/* Anschaffungsdatum */
fvbNr INTEGER not null default 0, /* Firmennummer des Lieferanten */
typBesch CHAR(1) not null default 'k', /* Miete, Kauf, Leihe, Spende,... */
anschKosten FIXED (11,2) default 0, /* Anschaffungskosten in EUR */
repKosten FIXED (11,2) default 0, /* aufgelaufene Reparaturkosten in EUR */
abschreibung FIXED (11,2) default 0, /* aufgelaufene Abschreibung in EUR */
datEliminiert DATE NOT NULL DEFAULT '1999-09-01',/* aus Inventar ausgeschieden am... */
vorhanden SMALLINT NOT NULL default 1, /* Menge laut Inventur */
invDat DATE not null default '1999-09-01',/* Inventur-Datum */
bemerkung VARCHAR (255) not null default ' ',
PRIMARY KEY (nummer),
UNIQUE INDEX (nummer),
INDEX (fvbNr),
INDEX (typBesch),
FOREIGN KEY (fvbNr) REFERENCES fvbPartner(nummer),
FOREIGN KEY (typBesch) REFERENCES invBeschTyp(code)
)
CHARACTER SET latin1 COLLATE latin1_german1_ci
ENGINE=InnoDB
;
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would help if you provided some information about what "using JDBC" means in the context of your problem.

And, welcome to the Ranch!
 
Heinrich Stoellinger
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hm...
When one defines a database under LibreOffice one specifies the way one wants to access that database.
This may mean
- what backend is being used at the DB-Server (e.g. Postgres, MySQL, etc.)
- HOW (what "connector") one wants to use to access that backend (e.g. ODBC, JDBC, "native" MySQL-API).
I have used ALL of these possibilities. JDBC works just fine, except in the case of the table I mentioned...
I suppose I will have to post this question in a LibreOffice forum. It is LibreOffice/OpenOffice that actually "fires"
the JDBC-related API-calls. There might be some bug in the way they use the connector.
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose it could be their bug. But when I encounter something that doesn't work, my first response is to assume it's my bug. (And that has almost never failed me!) So yes, you could ask your question on a LibreOffice forum, but in the meantime I would suggest checking your own code. It's possible that you made some error which you didn't notice.
 
Heinrich Stoellinger
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Paul,
There is NO code on my part - apart from the definition of the type of connection in LO-Base. And - as I mentioned before -
all other tables work just fine under JDBC, it is only that ONE table. Also, it displays o.k. using the so-called native MySQL-
connector under LO-Base and the command-line client in Linux. So, there cannot really be anything wrong in the definition
of the table inside the MySQL-Database itself.
I have posted the question in the LibreOffice user mail-list. Maybe I will find out more this way. I will post any constructive
replies here...
Thanks for your ideas, anyway.
Regards from snowed-in Salzburg (Austria)
H. Stoellinger
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No code on your part?

Then perhaps it's a bug in the thing which displays the table content, then. Is that part of LibreOffice also? I was assuming you'd written some JDBC code in Java which failed to display the contents of this particular table for some reason.

Regards from Vancouver (desperately needing snow for ski resorts)
 
Heinrich Stoellinger
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Paul,
Things with JDBC seem to be functioning again all of a sudden! All I did (and I don't honestly know whether this was the REAL reason:
is - I added ?zeroDateTimeBehavior=convertToNull to the connection string when defining the DB to LibreOffice.
Thanks for your attention - and we had a LOT of snow again last night! The ski resorts are happy now!
Regards
Heinrich
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic