Results 1 to 17 of 17
  1. #1
    projecttoday is offline Member
    Join Date
    Nov 2010
    Posts
    16
    Rep Power
    0

    Default Newbie wanting to create a desktop application with Java. Possible?

    I am a newbie with Java trying to create a desktop application and I'd like to know what databases Java supports or how does Java read and write data? Can you create a setup disk with Java and give it to someone so they can install a working program on their computer in one step?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    The requirement for java apps is that java must be installed on the PC.
    Given that, then copying a jar file would install the program if it was completely contained in the jar file.

  3. #3
    projecttoday is offline Member
    Join Date
    Nov 2010
    Posts
    16
    Rep Power
    0

    Default

    So you're saying if you wanted to write a program like QuickBooks in Java, that Java would have to be installed on the target pc in order to work?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    The target PC would need to have a version of the JRE installed to be able to execute java programs.
    If the program requires other libraries, they would also have to be on the target PC.

  5. #5
    Joel's Avatar
    Joel is offline Member
    Join Date
    May 2011
    Location
    Placerville, CA
    Posts
    86
    Rep Power
    0

    Default

    That's super easy. Make sure you download the latest JDK (this will allow you to compile and debug your application in an IDE and it has a JRE built in - JRE is Java Runtime Environment. Then once you can run your program export into a JAR file (Java ARchive) and those are fully executable. You can send these files and as long as the user has the same JRE or later on their machine they can run the program. You also must specify when creating the JAR File where your entry point in the program is. Usually that's where your static main() resides. Good luck, it's such a fun thing, Java.

  6. #6
    projecttoday is offline Member
    Join Date
    Nov 2010
    Posts
    16
    Rep Power
    0

    Default

    What kind of database do you use in your apps?

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    I don't use databases.

  8. #8
    projecttoday is offline Member
    Join Date
    Nov 2010
    Posts
    16
    Rep Power
    0

    Default

    What do you use to store data?

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by projecttoday View Post
    What kind of database do you use in your apps?
    I normally abstract (as much as possible) the particular dabase from the code. Java has DataSources as well as DriverManagers that allow you to create a connection to any database that implements a JDBC driver. Since Java 1.6 (or was it 1.5?) the JDK comes bundled with a nice rdbms, JavaDB (or alternatively named Derby) created by the Apache foundation. It doesn't cost anything and is a very nice place to start.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    projecttoday is offline Member
    Join Date
    Nov 2010
    Posts
    16
    Rep Power
    0

    Default

    When you abstract your database does that mean you do or do not use JavaDB/Derby?

  11. #11
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    When you abstract your database does that mean you do or do not use JavaDB/Derby?
    Neither. He can use any database with the same code. The JDBC driver acts as an interface that is known by (implemented by) many databases.
    So your code doesn't depend on databasespecific commands.
    Compare datasource with foodsource. A cow is less abstracted from its foodsource then you are. A cow has only the "commands" to digest grass, you are implementing cakedigestion, breaddigestion, meatloafdigestion and potatochipsdigestion (but don't try grass). With such an JDBC-like interface the cow could use all those tastfull foods, and you could use grass.
    (Sorry Jos, I figure you could have explained it yourself.)
    Last edited by Jodokus; 07-16-2011 at 12:43 AM.
    No bug ever had to calculate its fitnessfunction.

  12. #12
    projecttoday is offline Member
    Join Date
    Nov 2010
    Posts
    16
    Rep Power
    0

    Default

    What's the catch? I've been learning Visual Basic .Net for the last 10 years.

  13. #13
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    What's the catch? I've been learning Visual Basic .Net for the last 10 years.
    Do you mean I told you nothing new? You really asked what abstracting from a database means. You could have asked what database he uses. But sorry if I offended you. This is "New to Java", so you expect newby-questions.
    No bug ever had to calculate its fitnessfunction.

  14. #14
    projecttoday is offline Member
    Join Date
    Nov 2010
    Posts
    16
    Rep Power
    0

    Default

    You did not offend me.

  15. #15
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    Thank god (or spaghettimonster or whatever) .
    Last edited by Jodokus; 07-16-2011 at 01:24 AM. Reason: Added missing smiley
    No bug ever had to calculate its fitnessfunction.

  16. #16
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Jodokus View Post
    Neither. He can use any database with the same code. The JDBC driver acts as an interface that is known by (implemented by) many databases.
    So your code doesn't depend on databasespecific commands.
    Compare datasource with foodsource. A cow is less abstracted from its foodsource then you are. A cow has only the "commands" to digest grass, you are implementing cakedigestion, breaddigestion, meatloafdigestion and potatochipsdigestion (but don't try grass). With such an JDBC-like interface the cow could use all those tastfull foods, and you could use grass.
    (Sorry Jos, I figure you could have explained it yourself.)
    No need to apologize; I had my mouth filled with grass ...

    kind regards,

    Jos *moooo!*
    cenosillicaphobia: the fear for an empty beer glass

  17. #17
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    I had my mouth filled with grass
    With JDBC you could digest fruitcake...
    No bug ever had to calculate its fitnessfunction.

Similar Threads

  1. Book about a java desktop database application
    By jcd21 in forum New To Java
    Replies: 3
    Last Post: 04-04-2011, 11:24 AM
  2. creating java desktop application
    By highfive in forum New To Java
    Replies: 2
    Last Post: 03-29-2010, 04:14 PM
  3. Replies: 3
    Last Post: 12-04-2009, 12:10 PM
  4. Replies: 0
    Last Post: 08-18-2009, 04:50 PM
  5. Installer for Java desktop application
    By nitingupta183 in forum SWT / JFace
    Replies: 0
    Last Post: 03-18-2008, 07:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •