File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes SQL Error in exporting db schema Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "SQL Error in exporting db schema" Watch "SQL Error in exporting db schema" New topic
Author

SQL Error in exporting db schema

Brian yap
Greenhorn

Joined: Nov 23, 2001
Posts: 3
Hi,
I get SQL error in exporting db schema when, it came out with the following error message:
>>>executing: ALTER TABLE TimeSheetEntryEJB ADD CONSTRAINT TimeSheetEntryEJBPK PRIMARY KEY ( entryId)
>>>>Exception occurred: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0107N The name "TIMESHEETENTRYEJBPK" is too long. The maximum length is "18". SQLSTATE=42622
SQL exception Occurred: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0107N The name "TIMESHEETENTRYEJBPK" is too long. The maximum length is "18". SQLSTATE=42622
How would I solved this problem.
By the way this is the sample from Kyla Brown's book in Chapter 19. I'm unsure what do to do to solve the problem, as I believed I might have left some steps or needs some modification.
Any help would be greatly appreciated. Thanks.
Cheers
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
Actually, I'm reasonably sure that I did cover this somewhere in the book... All you have to do is in the VAJ Schema editor set a new physical name for those entries that it complains are too long.
For instance, instead of using TIMESHEETENTRYEJBPK as the physical name for this primary key constraint, use TSEntryPK. The only thing you have to do then is export the schema to the database and then regenerate the deployment classes inside of VAJ.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
 
subject: SQL Error in exporting db schema
 
Threads others viewed
stored procedure giving me sql error
please help urgently ...strange error
Handling Clob in Hibernate 3 & DB2 8.1
Confused by stored procedure sql error
Confused by Stored Procedure Error
developer file tools