invalid column name (yes... there's a space in it)

30 views
Skip to first unread message

Yuri Cauwerts

unread,
Feb 11, 2014, 8:06:16 AM2/11/14
to minute...@googlegroups.com
Hi there,

Just discovered this nice project, good work!

When trying this on my database I get an error due to a column name that contains a space (I know, one shouldn't...)
Anyhow, impossible to change thatt atm, is it possible to enable setDelimitedIdentifierModeOn() somehow?
I suppose that will surround my columnnames with square brackets? 

I am using MSSQL Server 2008 on Windows8, JDK7.

Exception in thread "AWT-EventQueue-0" org.apache.ddlutils.DatabaseOperationException: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name
        at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1891)
        at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1869)
        at net.sf.minuteProject.configuration.bean.model.data.impl.DDLUtils.DatabaseDDLUtils.loadDatabase(DatabaseDDLUtils.java:76)
        at net.sf.minuteProject.configuration.bean.model.data.impl.DDLUtils.DatabaseDDLUtils.<init>(DatabaseDDLUtils.java:58)
        at net.sf.minuteProject.configuration.bean.model.data.DataModelFactory.getDatabase(DataModelFactory.java:18)
        at net.sf.minuteProject.configuration.bean.DataModel.loadDatabase(DataModel.java:49)
        at net.sf.minuteProject.application.ModelGenerator.loadModel(ModelGenerator.java:254)
        at net.sf.minuteProject.application.ModelViewGenerator.loadModel(ModelViewGenerator.java:64)
        at net.sf.minuteProject.application.ModelGenerator.getEnrichedModel(ModelGenerator.java:200)
        at net.sf.minuteProject.application.ModelGenerator.generate(ModelGenerator.java:169)
        at net.sf.minuteProject.application.AbstractGenerator.generate(AbstractGenerator.java:219)
        at net.sf.minuteProject.console.panel.TargetPanel$ClickListener.actionPerformed(TargetPanel.java:90)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
        at java.awt.Component.processMouseEvent(Component.java:6527)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
        at java.awt.Component.processEvent(Component.java:6292)
        at java.awt.Container.processEvent(Container.java:2234)
        at java.awt.Component.dispatchEventImpl(Component.java:4883)
        at java.awt.Container.dispatchEventImpl(Container.java:2292)
        at java.awt.Component.dispatchEvent(Component.java:4705)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
        at java.awt.Container.dispatchEventImpl(Container.java:2278)
        at java.awt.Window.dispatchEventImpl(Window.java:2739)
        at java.awt.Component.dispatchEvent(Component.java:4705)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
        at java.awt.EventQueue.access$400(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:697)
        at java.awt.EventQueue$3.run(EventQueue.java:691)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.awt.EventQueue$4.run(EventQueue.java:719)
        at java.awt.EventQueue$4.run(EventQueue.java:717)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'soort'.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:616)
        at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
        at org.apache.ddlutils.platform.JdbcModelReader.determineAutoIncrementFromResultSetMetaData(JdbcModelReader.java:1152)
        at org.apache.ddlutils.platform.mssql.MSSqlModelReader.readTable(MSSqlModelReader.java:105)
        at org.apache.ddlutils.platform.JdbcModelReader.readTables(JdbcModelReader.java:521)
        at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:476)
        at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:436)
        at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1884)
        ... 47 more

Regards,
-Yuri

florian adler

unread,
Feb 11, 2014, 10:47:26 AM2/11/14
to minute...@googlegroups.com
Hello Yuri,

Nice to hear. Thanks for trying and reporting!

Yes indeed, for the moment you have to make sure the table do not contains some space in the name.

This might be the case for mssql.

I made a demo with Northwind database that I had to patched (http://minuteproject.blogspot.nl/2013/08/northwind-db-revisited-with-mp-4-ox.html)

I will look at how to patch ddlutils (that i use to retrieve metadata) to add delimiters; I will investigate the setDelimitedIdentifierModeOn option.

Best regards,

Florian.


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes minuteproject.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse minuteprojec...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .

Yuri Cauwerts

unread,
Feb 14, 2014, 8:46:24 AM2/14/14
to minute...@googlegroups.com
Hello Florian,

Great!
I am looking forward to the patch.

Best regards,
-yuricts

Reply all
Reply to author
Forward
0 new messages