You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by MarcelK1607 <ma...@gmail.com> on 2009/05/19 17:35:32 UTC

No changes applied in Java? Cant find it in derby tools.

i've written some java code to connect and update a small test database.
I create a table in Java code, but when i look into my database there is
nothing there.
There seems to be some difference in between connecting in Java and using
the CLI.

Any tips / pointers on how to tackle this?
I am using the embedded jdbc driver.
-- 
View this message in context: http://www.nabble.com/No-changes-applied-in-Java--Cant-find-it-in-derby-tools.-tp23618841p23618841.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: No changes applied in Java? Cant find it in derby tools.

Posted by Kathey Marsden <km...@sbcglobal.net>.
Rick Hillegas wrote: 
> Hi Marcel,
>
> Are you saying that the table is created but that it disappears after 
> you exit the program? Have you changed the autocommit state of the 
> connection? It may be that your table-creating transaction is rolled 
> back when you exit.
>
Other common errors are:
1) You connected with a different user and so the default schema is 
different.  Your table is still there but in the schema that corresponds 
to the user with which you originally connected.

2) Your derby.system.home is different so you are actually accessing a 
different database.
Search your file system for databases of the same name to make sure you 
are accessing the same one.

Kathey


Re: No changes applied in Java? Cant find it in derby tools.

Posted by Rick Hillegas <Ri...@Sun.COM>.
MarcelK1607 wrote:
> i've written some java code to connect and update a small test database.
> I create a table in Java code, but when i look into my database there is
> nothing there.
>   
Hi Marcel,

Are you saying that the table is created but that it disappears after 
you exit the program? Have you changed the autocommit state of the 
connection? It may be that your table-creating transaction is rolled 
back when you exit.

Hope this helps,
-Rick
> There seems to be some difference in between connecting in Java and using
> the CLI.
>
> Any tips / pointers on how to tackle this?
> I am using the embedded jdbc driver.
>   


Re: No changes applied in Java? Cant find it in derby tools.

Posted by Kristian Waagan <Kr...@Sun.COM>.
MarcelK1607 wrote:
> i've written some java code to connect and update a small test database.
> I create a table in Java code, but when i look into my database there is
> nothing there.
> There seems to be some difference in between connecting in Java and using
> the CLI.
> 
> Any tips / pointers on how to tackle this?

Hi Marcel,

Just make sure you actually access the same database from your Java 
program and the CLI tool you are using. The easiest way is to use 
absolute paths in the connection URL, but there are other ways.


-- 
Kristian

> I am using the embedded jdbc driver.