File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes create table auto_increment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "create table auto_increment" Watch "create table auto_increment" New topic

create table auto_increment

Oczek Oczkowy

Joined: Nov 01, 2006
Posts: 12
i have really simple quest. i use netbeans 5.5 and jdbc delivered. i need create new table with field autoincrement. i typed in netbeans sqlcommand:

i got error Error code -1, SQL state 42X01: Syntax error: Encountered "auto_increment" at line 3, column 25.
Line 1, column 1

Execution finished after 0 s, 1 error(s) occurred.

how to create autoincrement field? i tried type AUTO_INCREMENT and auto-increment but the result is the same.
thanks mooses

fak de sys
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

This syntax may be database specific. What database are you using?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Oczek Oczkowy

Joined: Nov 01, 2006
Posts: 12
its a standard database delivered with netbeans tool.i have installed:

Java Platform, Enterprise Edition 5 (Java EE 5) Tools Bundle, Multi-language
Be among the first to take advantage of the ease-of-development features in Java EE 5! The Java EE 5 Tools Bundle, Multi-language is a complete, developer-friendly environment with all necessary runtimes installed and fully configured. Java EE 5 Tools Bundle, Multi-language includes the following components:
NetBeans IDE 5.5, Multi-language
NetBeans Enterprise Pack 5.5, Multi-language
Sun Java System Application Server Platform Edition 9 Update 1, Multi-language
Project Open ESB Starter Kit, Multi-language
Sun Java System Access Manager 7.1 Beta
Java EE 5 Samples
Java BluePrints
API docs (Javadoc)
Your First Cup: An Introduction to the Java EE Platform
gierre treter

Joined: May 09, 2007
Posts: 1
i have the same problem...
i can't set a auto_increment field
someone can help us?

I agree. Here's the link:
subject: create table auto_increment
It's not a secret anymore!