Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using ant create-tables in NetBeans 5.5

 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I'm folloing the Java J2ee tutorial and it's instructing me to use ant create-tables to populate the sample tables.

Here is the instructions off the Sun site:
http://java.sun.com/javaee/5/docs/tutorial/doc/WebApp6.html#wp69868

When you deploy any of the Duke's Bookstore applications using ant deploy, the database is automatically populated at the same time. If you want to populate the database separately from the deploy task or are using NetBeans 5.5 to deploy the application, follow these steps:

In a terminal window, go to the books directory or any one of the bookstore1 through bookstore6 example directories.
Start the Java DB database server. For instructions, see Starting and Stopping the Java DB Database Server. You don't have to do this if you are using NetBeans 5.5. It starts the database server automatically.
Run ant create-tables. This task runs a command to read the file tutorial.sql and execute the SQL commands contained in the file.
At the end of the processing, you should see the following output:
...
[sql] 181 of 181 SQL statements executed successfully

When you are running create-tables, don't worry if you see a message that an SQL statement failed. This usually happens the first time you run the command because it always tries to delete an existing database table first before it creates a new one. The first time through, there is no table yet, of course.



Where am I typing this "ant create-tables" command?
I went into the runtime window and right clicked a database and selected execute command. Then the SQL window opened up and I put ant create tables in there and it didn't work.
The tables are already created somewhere , it's a sample, but I don't know how to populate them and the instructions aren't making sense and aren't telling me WHERE i type the ant command!!!
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Jay,
Please don't post the same question in multiple forums. I'll lock this so all answers can go in the Ant thread.
 
Catch Ernie! Catch the egg! And catch this tiny ad too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic