Domanda

I have created an desktop application in Netbeans 7.0 and i have the files, app, view and aboutbox.

And i want to add an database object that is accessible in the application in the duration of the applications lifetime, that closes when the app closes.

I am using the JT400 library to connect to an A/S 400 system for the database queries, so i cant use the database desktop application route. (or if I can, enlighten me)

I would like to have a database object that i can access throughout the entire project and fill my GUI/lists/comboboxes with this connection, and then use it also during the application usage when the customer makes queries to the database.

But I cant seem to find a good tutorial on how to do this. Anyone have ideas, and im pretty fresh with the swing framework as well.

I tried first to make an Java application and add the elements myself, but the layout part took too much time so i want to have the ability to layout the application through Netbeans.

È stato utile?

Soluzione

Here's a tutorial on how to build a Java desktop application that talks to a database in NetBeans. Spend some time going through the tutorial and check out the code. Run the code in debug mode to have a sense how does it execute and it's going to be much easier to build such an app.

Altri suggerimenti

How about mapping DB Table to java entity Classes using Hibernate ?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top