I am following the tutorial here: Getting Started (The Java™ Tutorials > JDBC(TM) Database Access > JDBC Basics)
I can get to the very bottom of that page, where I use ant to compile the examples, then run setup to create the tables, but when I try to run any of the examples that deal with that table data, I get a SQLSyntaxErrorException saying that 'SHOW_SUPPLIERS' does not exist.
I'm not sure whether the setup command is working correctly- it doesn't error out, but it also says "0 of 0 SQL statements executed successfully" which seems strange. I suspect something is going wrong on this step, but I'm not sure what.
I've been googling all evening trying to figure out what I'm doing wrong, but I can't see anything. I'm sure it's something stupid, but I'm an absolute novice with database stuff.
Here's the full log of me following the command line instructions from the tutorial, with resulting error messages:
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\kworkman>cd Desktop C:\Documents and Settings\kworkman\Desktop>cd "JDBC Tutorials" C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials>cd JDBCTutorial C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial>ant jar Buildfile: C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial\build.xml compile: [echo] JDBC Tutorial is using C:/Program Files/Java/jdk1.6.0_29/bin/javac as Java compiler [javac] C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial\build.xml:59: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds jar: BUILD SUCCESSFUL Total time: 0 seconds C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial>ant setup Buildfile: C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial\build.xml setup: drop-tables: [sql] Executing resource: C:\Documents and Settings\kworkman\Desktop\JDBCTutorials\JDBCTutorial\sql\derby\drop-tables.sql [sql] 0 of 0 SQL statements executed successfully build-tables: [sql] Executing resource: C:\Documents and Settings\kworkman\Desktop\JDBCTutorials\JDBCTutorial\sql\derby\create-tables.sql [sql] 0 of 0 SQL statements executed successfully populate-tables: [sql] Executing resource: C:\Documents and Settings\kworkman\Desktop\JDBCTutorials\JDBCTutorial\sql\derby\populate-tables.sql [sql] 0 of 0 SQL statements executed successfully BUILD SUCCESSFUL Total time: 0 seconds C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial>ant javadb-create-procedure Buildfile: C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial\build.xml javadb-create-procedure: [sql] Executing commands [sql] Failed to execute: drop procedure SHOW_SUPPLIERS BUILD FAILED C:\Documents and Settings\kworkman\Desktop\JDBC Tutorials\JDBCTutorial\build.xml:108: java.sql.SQLSyntaxErrorException: 'DROP PROCEDURE' cannot be performed on'SHOW_SUPPLIERS' because it does not exist. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:775) at org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:745) at org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLExec.java:1043) at org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000(SQLExec.java:985) at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:653) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.sql.SQLException: 'DROP PROCEDURE' cannot be performed on 'SHOW_SUPPLIERS' because it does not exist. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 29 more Caused by: ERROR 42Y55: 'DROP PROCEDURE' cannot be performed on 'SHOW_SUPPLIERS' because it does not exist. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.compile.DropAliasNode.bindStatement(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepa reInternalStatement(Unknown Source) ... 23 more Total time: 0 seconds