SQL Error while build and run main project

3 views
Skip to first unread message

lookie

unread,
Apr 7, 2008, 5:10:21 PM4/7/08
to CropPlanning Development
Hi Clayton,

I'm trying to build and run the main project and I find that I keep
getting an error when it tries to create the HSQL DB. Is this a known
bug or just something I am doing wrong?

This is the error message I'm getting:

java.sql.SQLException: Unexpected token: YEAR in statement [CREATE
TABLE "CROP_PLANS" ( id INTEGER IDENTITY, plan_name
VARCHAR(256) year]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.executeUpdate(Unknown Source)
at CPS.Core.DB.HSQLDBCreator.createTables(HSQLDBCreator.java:
54)
at CPS.Core.DB.HSQLConnect.connectToNew(HSQLConnect.java:152)
at CPS.Core.DB.HSQLConnect.createDB(HSQLConnect.java:49)
at CPS.Core.DB.HSQLDB.initAndUpdateDB(HSQLDB.java:81)
at CPS.Core.DB.HSQLDB.<init>(HSQLDB.java:72)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
513)
at CPS.ModuleManager.loadPlugin(ModuleManager.java:121)
at CPS.ModuleManager.loadPlugin(ModuleManager.java:84)
at CPS.ModuleManager.getDM(ModuleManager.java:56)
at CPS.CropPlanning.<init>(CropPlanning.java:57)
at CPS.CropPlanning.main(CropPlanning.java:38)
DEBug(DBUpdater): DB is up to date!
DRIVER: Initializing module: CropPlans
java.sql.SQLException: Table not found in statement [SELECT DISTINCT
plan_name FROM "CROP_PLANS"]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.executeQuery(Unknown Source)
at
CPS.Core.DB.HSQLQuerier.getDistinctValuesForColumn(HSQLQuerier.java:
235)
at CPS.Core.DB.HSQLDB.getListOfCropPlans(HSQLDB.java:134)
at
CPS.Core.CropPlans.PlanManager.updateListOfPlans(PlanManager.java:111)
at
CPS.Core.CropPlans.PlanManager.setDataModel(PlanManager.java:78)
at
CPS.Core.CropPlans.CropPlanList.setDataSource(CropPlanList.java:83)
at
CPS.UI.Modules.CPSMasterDetailModule.setDataSource(CPSMasterDetailModule.java:
100)
at CPS.CropPlanning.<init>(CropPlanning.java:70)
at CPS.CropPlanning.main(CropPlanning.java:38)
Exception in thread "main" java.lang.IllegalArgumentException:
setSelectedIndex: 0 out of bounds
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:603)
at
CPS.Core.CropPlans.PlanManager.updateListOfPlans(PlanManager.java:122)
at
CPS.Core.CropPlans.PlanManager.setDataModel(PlanManager.java:78)
at
CPS.Core.CropPlans.CropPlanList.setDataSource(CropPlanList.java:83)
at
CPS.UI.Modules.CPSMasterDetailModule.setDataSource(CPSMasterDetailModule.java:
100)
at CPS.CropPlanning.<init>(CropPlanning.java:70)

Clayton Carter

unread,
Apr 7, 2008, 10:52:10 PM4/7/08
to cropplann...@googlegroups.com
Nope, my fault. I forgot a comma in the SQL spec for when NEW tables
are created, but I got it right for when OLD tables are updated.
Anyway, I just pushed that little comma back to the source. If you
"update" your sources, it should work again.

Sorry for the confusion.

C

lookie

unread,
Apr 8, 2008, 8:20:00 AM4/8/08
to CropPlanning Development
Thanks, just a bit of update on the GUI side: I'm on to creating the
class for the credits as suggested. I have the Credits GUI up and i
know how to put a pic in it so when we have a pic ready for the
credits just holler. Apologies if I am taking a somewhat long-ish time
to do this.

Luqman

Clayton Carter

unread,
Apr 8, 2008, 1:20:40 PM4/8/08
to cropplann...@googlegroups.com
Hi Luqman,

For the time being, you can just use the two images which are used on
the front page of the project website, at the bottom. Each will
have to have some text associated w/ it; just a name at the very
least, but possibly some more. For the first image, the name is
"Northeast SARE" and text would be "This project is partially funded
by USDA's Sustainable Agriculture Research and Education (SARE)
program. (Project FNE07-600)". The second image should be named "The
Maine Organic Farmers and Gardeners Association" and the text can be
"Support and advice generously provided by MOFGA".

Thanks! Don't sweat about taking your time. Things are beginning to
get crazy here on our farm and it's great to have folks who are
interested in picking up some of my slack. :)

Clayton

Clayton Carter

unread,
May 19, 2008, 10:29:14 PM5/19/08
to cropplann...@googlegroups.com
Hi Luqman,

Just checking in. Have you been able to make any progress on this?
No sweat if you havent: I haven't been able to work on the project at
all recently.

Let me know,
Clayton

Reply all
Reply to author
Forward
0 new messages