This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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.
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!