Link to home
Create AccountLog in
Avatar of Absente
Absente

asked on

Java Database

Hi. I am planing to write a book library system.
I need a database. I am not use database with java so far today.
Which database is best stable with java ?
what is your opinion which database  ?
database could bee free

than any documment with using databbase with java ?
Avatar of Mick Barry
Mick Barry
Flag of Australia image

java comes with Derby included in the jdk
http://developers.sun.com/javadb/
which database is best really depends on your application and needs
ASKER CERTIFIED SOLUTION
Avatar of mrcoffee365
mrcoffee365
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Absente
Absente

ASKER

is there any database like Ms access. I want to this. database could be user computer and.
for example i can edit Ms acees database. I am looking your link. its so complex. I want to this. there is an software. i can creaate column or rows. then. i insert someting database with java.
you can use access (and most db's) with java, you just need the appropriate driver
Avatar of Absente

ASKER

acan you suggesst any database like ms access. I wana edit database(adding roww, deleting row) with an editor like ms acess
Avatar of Absente

ASKER

my problem is how to create database on my computer.
typically you would use sql to create your database
if you're not comfortable with that then you can use Access. Not a great database choice though.
Avatar of Absente

ASKER

Can I create sql databse with netbeans and can i creta table with netbeans
Avatar of Absente

ASKER

Icreta a dersy database with netbeans.

I wana creta table. but tehere is too many options.  APP, SYS, SYSCAT, SYSFUN, NULLID......

hoe can I creta table. In your tourtianl. I cant fount this ? Whic can I select to creta table ?
I mean. I can cretate table withh APP what this the difeerence with sys ?
Its explained under "Create a Table"

"Now that we have a database, let us create a simple 2-column table "TABLE 1". Press "Ctrl + 5" to bring up the "Services" side-bar."
Avatar of Absente

ASKER

I upload photo. there is a lot of sellection.
aasdasd.PNG
thats system stuff, you don't need to worry about that.
Avatar of Absente

ASKER

where I can creta table ?

in APP , in SYS ? which was ? what is the difference ?
in App>Tables
Avatar of Absente

ASKER

ok I create Table in APP.

but I try to connect DB I have an eror Message.

does nort contain tables.

in picture you can see
Ekran-Al-nt-s-.PNG
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Absente

ASKER

I get error insertimg data.


[TopLink Info]: 2010.02.22 04:17:33.981--ServerSession(29384701)--TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))
[TopLink Info]: 2010.02.22 04:17:34.356--ServerSession(29384701)--file:/C:/Users/Yasin/Documents/NetBeansProjects/DesktopApplication4/src/-yasindbPU login successful
Exception in thread "AWT-EventQueue-0" java.lang.Error: java.lang.reflect.InvocationTargetException
        at org.jdesktop.application.ApplicationAction.actionFailed(ApplicationAction.java:859)
        at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:665)
        at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:698)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
        at java.awt.Component.processMouseEvent(Component.java:6263)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
        at java.awt.Component.processEvent(Component.java:6028)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:662)
        ... 27 more
Caused by: javax.persistence.EntityExistsException:
Exception Description: Cannot persist detached object [desktopapplication4.Usertable[iid=1]].
Class> desktopapplication4.Usertable Primary Key> [1]
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:208)
        at desktopapplication4.DesktopApplication4View.newRecord(DesktopApplication4View.java:133)
        ... 32 more
Caused by: Exception [TOPLINK-7231] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.ValidationException
Exception Description: Cannot persist detached object [desktopapplication4.Usertable[iid=1]].
Class> desktopapplication4.Usertable Primary Key> [1]
        at oracle.toplink.essentials.exceptions.ValidationException.cannotPersistExistingObject(ValidationException.java:2171)
        at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:3251)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:339)
        at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3220)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:205)
        ... 33 more
javax.persistence.RollbackException: Transaction rolled back because transaction was set to RollbackOnly.
        at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:110)
        at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:60)
        at desktopapplication4.DesktopApplication4View$SaveTask.doInBackground(DesktopApplication4View.java:166)
        at desktopapplication4.DesktopApplication4View$SaveTask.doInBackground(DesktopApplication4View.java:160)
        at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)


what is the problem ?
You need to add tables to the db. What is your structure?
Avatar of Absente

ASKER

I create Table. I upload Screen shots
Ekran-Al-nt-s-1.PNG
Ekran-Al-nt-s-3.PNG
Avatar of Absente

ASKER

I  think problem ID
Outo increment at
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Absente

ASKER

How can I solve tihs ?
I have work this sample database aplication in netbeans.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account