aspose file tools*
The moose likes JDBC and the fly likes help with the derby-ij tool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "help with the derby-ij tool" Watch "help with the derby-ij tool" New topic
Author

help with the derby-ij tool

krillian konstatos
Ranch Hand

Joined: Jan 03, 2011
Posts: 49

hello, everyone!

I have a question about how yuo export tables that you create using the ij tool in the derby tool.
I know that there are many many texts about this out there but i haven't learned the ij tool that
well yet so far i have created my derby tables directly in the java source code but i have realized
that it is not that recommended to do maybe i am totally wrong about this but there is that
message "Table/View 'MY_TABLE' already exists in Schema x" that comes out so often when i
am creating tables in the java source code and i have managed to avoid this using a method
that takes care of a "drop table if exists" action properly yet. I know that there are an error code
that represent the table already exists exception in derby but my time is limited and i have
read in some posts on the web that the best way to use tables in a application that uses the
embedded derby driver is to use the ij tool to put them in jar files and then add them to the
classpath or have i missunderstood something completely here? my questions is as shown below

1. How do i export and tables from the ij tool in jar files so that i can put theese to my classpath
so my applications can access them directly after startup without creating them in some class or
method? If someone could explain this in a list-based step my appreciation would then go
beyond limits.

2. How can i avoid SQLState-errors properly using for example a boolean method?

I hope i haven't been totally wrong about the issues in question. I am struggling very hard to
learn jdbc and tools like ant and maven.

Very kind regards,
krillian.
krillian konstatos
Ranch Hand

Joined: Jan 03, 2011
Posts: 49

Hi!

I have fixed my problem with the "table alredy exists" exception as shown in the
code snippet below theese lines ...



It would be great if i got some feedback on my approach to validate the table names in the database.
I hope someone can see what i am concerned with and tell me if i am close to a general solution to
my problem in question or not.

When it comes to working with derby at command prompt level and in the ant and maven environments
i have much left to learn. Thanks a lot in advance anyway!

Thanks a lot in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help with the derby-ij tool