Discussion:
[Middlegen-user] middlegen and hsql
Jens Kumpfmueller
2002-02-11 09:27:03 UTC
Permalink
hi,

is there a possibilty of using hypersonic database (from jboss) with
middlegen?
i tried it as follows: i changed the databaseurl to
"jdbc:hsqldb:hsql://localhost:1476" and the driver to "org.hsql.jdbcDriver".

now i get: midllegen.MiddlegenException: Couldn't load database metadata

is that error my fault, or is it not (yet?) implemented to use hsql db?

thx in advice

jens
a***@netcom.no
2002-02-11 10:14:37 UTC
Permalink
Hi Jens,

I haven't tried with hsql, but it would be fantastic if it worked.
As long as their JDBC driver fully supports meta data, it should work.

-Are you in batch or gui mode?
-Do you get a stack trace along with the error message?

Could you post the stack trace?

Aslak

----- Original Message -----
From: "Jens Kumpfmueller" <***@web.de>
Date: Monday, February 11, 2002 12:27 pm
Subject: [Middlegen-user] middlegen and hsql
Post by Jens Kumpfmueller
hi,
is there a possibilty of using hypersonic database (from jboss) with
middlegen?
i tried it as follows: i changed the databaseurl to
"jdbc:hsqldb:hsql://localhost:1476" and the driver to
"org.hsql.jdbcDriver".
now i get: midllegen.MiddlegenException: Couldn't load database
metadata
is that error my fault, or is it not (yet?) implemented to use
hsql db?
thx in advice
jens
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Jens Kumpfmueller
2002-02-11 11:20:06 UTC
Permalink
Post by a***@netcom.no
-Are you in batch or gui mode?
gui mode
Post by a***@netcom.no
-Do you get a stack trace along with the error message?
yes. here it is...

(middlegen.MiddlegenPopulator 341 ) Couldn't find class
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:535)
at java.sql.DriverManager.getConnection(DriverManager.java:174)
at
middlegen.MiddlegenPopulator.getMetaData(MiddlegenPopulator.java:329)
at
middlegen.MiddlegenPopulator.getRegularTableNames(MiddlegenPopulator.java:112)
at
middlegen.swing.JMiddlegenPanel$3.actionPerformed(JMiddlegenPanel.java:144)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1770)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1823)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:422)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:260)
at javax.swing.AbstractButton.doClick(AbstractButton.java:292)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1094)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:934)
at java.awt.Component.processMouseEvent(Component.java:5020)
at java.awt.Component.processEvent(Component.java:4819)
at java.awt.Container.processEvent(Container.java:1383)
at java.awt.Component.dispatchEventImpl(Component.java:3527)
at java.awt.Container.dispatchEventImpl(Container.java:1440)
at java.awt.Component.dispatchEvent(Component.java:3368)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2930)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
at java.awt.Container.dispatchEventImpl(Container.java:1426)
at java.awt.Window.dispatchEventImpl(Window.java:1568)
at java.awt.Component.dispatchEvent(Component.java:3368)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
middlegen.MiddlegenException: Couldn't load database metadata
at
middlegen.MiddlegenPopulator.getMetaData(MiddlegenPopulator.java:342)
at
middlegen.MiddlegenPopulator.getRegularTableNames(MiddlegenPopulator.java:112)
at
middlegen.swing.JMiddlegenPanel$3.actionPerformed(JMiddlegenPanel.java:144)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1770)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1823)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:422)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:260)
at javax.swing.AbstractButton.doClick(AbstractButton.java:292)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1094)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:934)
at java.awt.Component.processMouseEvent(Component.java:5020)
at java.awt.Component.processEvent(Component.java:4819)
at java.awt.Container.processEvent(Container.java:1383)
at java.awt.Component.dispatchEventImpl(Component.java:3527)
at java.awt.Container.dispatchEventImpl(Container.java:1440)
at java.awt.Component.dispatchEvent(Component.java:3368)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2930)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
at java.awt.Container.dispatchEventImpl(Container.java:1426)
at java.awt.Window.dispatchEventImpl(Window.java:1568)
at java.awt.Component.dispatchEvent(Component.java:3368)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
a***@netcom.no
2002-02-11 14:14:02 UTC
Permalink
----- Original Message -----
From: Jens Kumpfmueller <***@web.de>
Date: Monday, February 11, 2002 2:27 pm
Subject: Re: [Middlegen-user] middlegen and hsql
Post by a***@netcom.no
Post by a***@netcom.no
-Are you in batch or gui mode?
gui mode
Post by a***@netcom.no
-Do you get a stack trace along with the error message?
yes. here it is...
(middlegen.MiddlegenPopulator 341 ) Couldn't find class
java.sql.SQLException: No suitable driver
The DriverManager can't locate a JDBC driver for the database URL
you've specified. In other words, there is something bad with your URL.
Check the hsql docs.

You can also download the source via CVS and try to debug. -I'm quite
certain that this is not a Middlegen problem. (But I can't be sure of
course).

HTH

Aslak
Post by a***@netcom.no
at java.sql.DriverManager.getConnection(DriverManager.java:535)
at java.sql.DriverManager.getConnection(DriverManager.java:174)
at
middlegen.MiddlegenPopulator.getMetaData(MiddlegenPopulator.java:329)
at
middlegen.MiddlegenPopulator.getRegularTableNames
(MiddlegenPopulator.java:112)
Post by a***@netcom.no
at
middlegen.swing.JMiddlegenPanel$3.actionPerformed
(JMiddlegenPanel.java:144)
Post by a***@netcom.no
at
javax.swing.AbstractButton.fireActionPerformed
(AbstractButton.java:1770)
Post by a***@netcom.no
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed
(AbstractButton.java:1823)
Post by a***@netcom.no
at
javax.swing.DefaultButtonModel.fireActionPerformed
(DefaultButtonModel.java:422)
Post by a***@netcom.no
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:260)
at javax.swing.AbstractButton.doClick(AbstractButton.java:292)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick
(BasicMenuItemUI.java:1094)
Post by a***@netcom.no
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased
(BasicMenuItemUI.java:934)
Post by a***@netcom.no
at java.awt.Component.processMouseEvent(Component.java:5020)
at java.awt.Component.processEvent(Component.java:4819)
at java.awt.Container.processEvent(Container.java:1383)
at java.awt.Component.dispatchEventImpl(Component.java:3527)
at java.awt.Container.dispatchEventImpl(Container.java:1440)
at java.awt.Component.dispatchEvent(Component.java:3368)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2930)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
at java.awt.Container.dispatchEventImpl(Container.java:1426)
at java.awt.Window.dispatchEventImpl(Window.java:1568)
at java.awt.Component.dispatchEvent(Component.java:3368)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:193)
Post by a***@netcom.no
at
java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:147)
Post by a***@netcom.no
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
middlegen.MiddlegenException: Couldn't load database metadata
Post by a***@netcom.no
at
middlegen.MiddlegenPopulator.getMetaData(MiddlegenPopulator.java:342)
at
middlegen.MiddlegenPopulator.getRegularTableNames
(MiddlegenPopulator.java:112)
Post by a***@netcom.no
at
middlegen.swing.JMiddlegenPanel$3.actionPerformed
(JMiddlegenPanel.java:144)
Post by a***@netcom.no
at
javax.swing.AbstractButton.fireActionPerformed
(AbstractButton.java:1770)
Post by a***@netcom.no
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed
(AbstractButton.java:1823)
Post by a***@netcom.no
at
javax.swing.DefaultButtonModel.fireActionPerformed
(DefaultButtonModel.java:422)
Post by a***@netcom.no
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:260)
at javax.swing.AbstractButton.doClick(AbstractButton.java:292)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick
(BasicMenuItemUI.java:1094)
Post by a***@netcom.no
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased
(BasicMenuItemUI.java:934)
Post by a***@netcom.no
at java.awt.Component.processMouseEvent(Component.java:5020)
at java.awt.Component.processEvent(Component.java:4819)
at java.awt.Container.processEvent(Container.java:1383)
at java.awt.Component.dispatchEventImpl(Component.java:3527)
at java.awt.Container.dispatchEventImpl(Container.java:1440)
at java.awt.Component.dispatchEvent(Component.java:3368)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2930)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
at java.awt.Container.dispatchEventImpl(Container.java:1426)
at java.awt.Window.dispatchEventImpl(Window.java:1568)
at java.awt.Component.dispatchEvent(Component.java:3368)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:193)
Post by a***@netcom.no
at
java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:147)
Post by a***@netcom.no
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Jens Kumpfmueller
2002-02-11 14:30:01 UTC
Permalink
Post by a***@netcom.no
The DriverManager can't locate a JDBC driver for the database URL
you've specified. In other words, there is something bad with your URL.
Check the hsql docs.
this one was my fault. i used the wrong driver. now the error message is
the following

(middlegen.MiddlegenPopulator 126 ) ot found:
java.sql.SQLException: ot found:
at org.hsqldb.Trace.getError(Trace.java:180)
at org.hsqldb.Result.<init>(Result.java:175)
at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
at
org.hsqldb.jdbcDatabaseMetaData.executeSelect(jdbcDatabaseMetaData.java:2946)
at
org.hsqldb.jdbcDatabaseMetaData.getTables(jdbcDatabaseMetaData.java:1902)
at
middlegen.MiddlegenPopulator.getRegularTableNames(MiddlegenPopulator.java:112)
at
middlegen.swing.JMiddlegenPanel$3.actionPerformed(JMiddlegenPanel.java:144)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1770)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1823)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:422)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:260)
at javax.swing.AbstractButton.doClick(AbstractButton.java:292)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1094)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:934)
at java.awt.Component.processMouseEvent(Component.java:5020)
at java.awt.Component.processEvent(Component.java:4819)
at java.awt.Container.processEvent(Container.java:1383)
at java.awt.Component.dispatchEventImpl(Component.java:3527)
at java.awt.Container.dispatchEventImpl(Container.java:1440)
at java.awt.Component.dispatchEvent(Component.java:3368)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2930)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
at java.awt.Container.dispatchEventImpl(Container.java:1426)
at java.awt.Window.dispatchEventImpl(Window.java:1568)
at java.awt.Component.dispatchEvent(Component.java:3368)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
middlegen.MiddlegenException: Couldn't get list of tables from database.
Probably a JDBC driver problem.
at
middlegen.MiddlegenPopulator.getRegularTableNames(MiddlegenPopulator.java:127)
at
middlegen.swing.JMiddlegenPanel$3.actionPerformed(JMiddlegenPanel.java:144)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1770)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1823)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:422)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:260)
at javax.swing.AbstractButton.doClick(AbstractButton.java:292)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1094)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:934)
at java.awt.Component.processMouseEvent(Component.java:5020)
at java.awt.Component.processEvent(Component.java:4819)
at java.awt.Container.processEvent(Container.java:1383)
at java.awt.Component.dispatchEventImpl(Component.java:3527)
at java.awt.Container.dispatchEventImpl(Container.java:1440)
at java.awt.Component.dispatchEvent(Component.java:3368)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2930)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
at java.awt.Container.dispatchEventImpl(Container.java:1426)
at java.awt.Window.dispatchEventImpl(Window.java:1568)
at java.awt.Component.dispatchEvent(Component.java:3368)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
a***@netcom.no
2002-02-12 05:20:04 UTC
Permalink
Hi Jens,

In case you didn't download the sources, here is some free debugging
for you:

108: public List getRegularTableNames() throws MiddlegenException {
109: ResultSet tableRs = null;
110: ArrayList tableNames = new ArrayList();
111: try {
112: tableRs = getMetaData().getTables
(_connectionSettings.getCatalog(), _connectionSettings.getSchema(),
null, getTypes());
113: while (tableRs.next()) {
114: String tableName = tableRs.getString
("TABLE_NAME");
115: String tableType = tableRs.getString
("TABLE_TYPE");
116: if ("TABLE".equals(tableType)) {
117: // it's a regular table
118: _log.debug("table:" +
tableName);
119: tableNames.add(tableName);
120: }
121: else {
122: _log.debug("Ignoring table " +
tableName + " of type " + tableType);
123: }
124: }
125: } catch (SQLException e) {
126: _log.error( e.getMessage(), e );
127: throw new MiddlegenException("Couldn't get list
of tables from database. Probably a JDBC driver problem.");
128: } finally {
129: try {
130: tableRs.close();
131: } catch (Exception ignore) {
132: }
133: }
134: return tableNames;
135: }

As you can see from your stack trace, it's at line 112 things start
going wrong. In order to understand what's going on, we need to know
what values are being passed to the getTables method, since the
exception is thrown from inside hsql after entering the getTables
method.

Do you think you could get Middlegen from CVS and do some debugging
around this point? It looks like an hsql bug, but I'm not sure.

FYI: I did try with hsql a couple of months ago, and it partly worked
with Middlegen. The tables showed up, but not the relationships. That's
because hsql's implementation of
java.sql.DatabaseMetaData.getCrossReference(...) didn't work as
expected back then. (It always returned an empty ResultSet). The hsql
guys promised to fix it, but nothing happened. Hopefully they have
fixed it now.

-And hopefully you're my man to find that out :-)

Thanks, pal

-Aslak

----- Original Message -----
From: Jens Kumpfmueller <***@web.de>
Date: Monday, February 11, 2002 5:36 pm
Subject: Re: [Middlegen-user] middlegen and hsql
Post by a***@netcom.no
Post by a***@netcom.no
The DriverManager can't locate a JDBC driver for the database
URL
Post by a***@netcom.no
you've specified. In other words, there is something bad with
your URL.
Post by a***@netcom.no
Check the hsql docs.
this one was my fault. i used the wrong driver. now the error
message is
the following
at org.hsqldb.Trace.getError(Trace.java:180)
ot found ?? What is "ot"?
Post by a***@netcom.no
at org.hsqldb.Result.<init>(Result.java:175)
at
org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
at
org.hsqldb.jdbcDatabaseMetaData.executeSelect
(jdbcDatabaseMetaData.java:2946)
Post by a***@netcom.no
at
org.hsqldb.jdbcDatabaseMetaData.getTables
(jdbcDatabaseMetaData.java:1902)
Post by a***@netcom.no
at
middlegen.MiddlegenPopulator.getRegularTableNames
(MiddlegenPopulator.java:112)
a***@netcom.no
2002-02-12 15:30:03 UTC
Permalink
This one went between Jens and I. Might be useful for other people too.

-Aslak

Loading...