Results 1 to 12 of 12
Like Tree1Likes
  • 1 Post By doWhile

Thread: Java, MySQL and Apple Mac computers

  1. #1
    RedLenin is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default Java, MySQL and Apple Mac computers

    I'm completely new to Java but not to OOP.

    I've started developing a Windows program using VB.Net and MS Access but I've now (belatedly, I know) decided that I would like it to be usable on other platforms, too, in particular on Apple Macs.

    For this reason I am considering a rewrite using Java and MySQL (on the basis that my present code could never be made to work on an Apple Mac - is that assumption correct?).

    Second question (assuming VB.Net and MS Access don't offer a solution) - is the combination of Java and MySQL a good way of achieving my aims?

    Third question, would the Java and MySQL code for my Windows project work without needing any alteration on the Apple Mac platform, or would it require considerable changes made to it (eg. needing some specific Java classes to replace their Windows equivalents)?

    Thanks in advance for your thoughts.

  2. #2
    Wnt2bsleepin is offline Senior Member
    Join Date
    Feb 2012
    Posts
    219
    Rep Power
    3

    Default Re: Java, MySQL and Apple Mac computers

    I am not too sure about your first question, and don't want to tell you something that is wrong.

    Java and MySQL is a great way to be cross platform, although I don't know the intentions of your project. Having a user install MySQL is a little bit of a pain, unless you're going to host the database on a server somewhere.

    The SQL syntax doesn't change depending on the language, but the way you implement it does.

  3. #3
    RedLenin is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default Re: Java, MySQL and Apple Mac computers

    Quote Originally Posted by RedLenin View Post
    Third question, would the Java and MySQL code for my Windows project work without needing any alteration on the Apple Mac platform, or would it require considerable changes made to it (eg. needing some specific Java classes to replace their Windows equivalents)?
    I think I've found the answer to this myself : the Java and MySQL code would be identical on both platforms. All I would need to make it work on an Apple Mac would be the Java Virtual Machine for the Apple Mac - is this correct?

  4. #4
    Wnt2bsleepin is offline Senior Member
    Join Date
    Feb 2012
    Posts
    219
    Rep Power
    3

    Default Re: Java, MySQL and Apple Mac computers

    Quote Originally Posted by RedLenin View Post
    I think I've found the answer to this myself : the Java and MySQL code would be identical on both platforms. All I would need to make it work on an Apple Mac would be the Java Virtual Machine for the Apple Mac - is this correct?
    Yes, I assumed that you were talking about the MySQL code being the same between Java and .net. The actual SQL calls are the same, but the way you do them is different depending on the language. All you need is a Java VM on the machines you want to run your program on.

  5. #5
    RedLenin is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default Re: Java, MySQL and Apple Mac computers

    Sorry to bump this but I've only had a reply from one person (and thank you!) on a subject that I would have thought lots of Java users would have an opinion.

  6. #6
    kaydell2 is offline Senior Member
    Join Date
    Dec 2012
    Posts
    107
    Rep Power
    0

    Default Re: Java, MySQL and Apple Mac computers

    I developed a database application using Java and the Derby database engine. I produced a JAR that works with both Mac and Windows without doing any configuration. It just works on both platforms.

    The GUI is based on Swing and the database work is based on Java's JDBC.

    Being an object-oriented programmer, I built upon Java Swing and JDBC to produce classes that I needed for my application. The reusable part I called "KFrame" which is general and more useful that just for my application. The rest of the code is called "ServiceWarrior" which you could think of as an example of how you can build upon KFrame.

    KFrame Download of Source Code:
    KFrame | Free software downloads at SourceForge.net

  7. #7
    RedLenin is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default Re: Java, MySQL and Apple Mac computers

    Thanks for the suggestion but I think I'd rather stay with what I know a little about (MySQL) than jump into a completely new DBMS (I'm already planning to do just that with Java itself!).

    Quote Originally Posted by Wnt2bsleepin View Post
    Having a user install MySQL is a little bit of a pain, unless you're going to host the database on a server somewhere.
    No, the application will run entirely on a local machine.
    With regard to users installing MySQL - can't this be automated in the installer or would they be expected to do it manually themselves?

  8. #8
    Wnt2bsleepin is offline Senior Member
    Join Date
    Feb 2012
    Posts
    219
    Rep Power
    3

    Default Re: Java, MySQL and Apple Mac computers

    Quote Originally Posted by RedLenin View Post
    Thanks for the suggestion but I think I'd rather stay with what I know a little about (MySQL) than jump into a completely new DBMS (I'm already planning to do just that with Java itself!).


    No, the application will run entirely on a local machine.
    With regard to users installing MySQL - can't this be automated in the installer or would they be expected to do it manually themselves?
    I wouldn't recommend having your user set us MySQL if they want to run it. It seems overly complicated if it's not needed. Why not use something like SQlite?

  9. #9
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: Java, MySQL and Apple Mac computers

    Question 1:
    For this reason I am considering a rewrite using Java and MySQL (on the basis that my present code could never be made to work on an Apple Mac - is that assumption correct?).
    Not unless you wish your users to jump through hoops such as installing VMWare. Java would make cross platform deployment much easier, and MySQL can be installed on both OS's as well

    Question 2:
    Second question (assuming VB.Net and MS Access don't offer a solution) - is the combination of Java and MySQL a good way of achieving my aims?
    Depends upon your aims. If you want an embedded database, you should use something that can be embedded. If you have a centralized server, you should make sure that if you use MySQL it is open to remote exceptions (some hosts prevent you from doing this), or that you can somehow communicate (often, database and client communications go through one or more server side scripts/applications)

    Question 3:
    Third question, would the Java and MySQL code for my Windows project work without needing any alteration on the Apple Mac platform, or would it require considerable changes made to it (eg. needing some specific Java classes to replace their Windows equivalents)?
    Java can run on both Mac and Windows. If you wish to use the platform specific features, then minor mods need to be made. For instance, mac has their application look and feel guidelines and a separate API one can use to conform to these guidelines. MySQL has deployments for both OS's, and would function the same, and the communication between the two should be platform independent.
    Fubarable likes this.

  10. #10
    RedLenin is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default Re: Java, MySQL and Apple Mac computers

    Quote Originally Posted by Wnt2bsleepin View Post
    I wouldn't recommend having your user set us MySQL if they want to run it. It seems overly complicated if it's not needed. Why not use something like SQlite?
    That sounds like a brilliant idea because an embedded database would possibly make ongoing maintenance of the program easier than using MySQL. Thanks for coming up with that idea - I hadn't even looked at SQLite before.

  11. #11
    RedLenin is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default Re: Java, MySQL and Apple Mac computers

    Quote Originally Posted by doWhile View Post
    If you want an embedded database, you should use something that can be embedded.
    Do you mean something like SQLite? Would MySQL be more difficult to maintain (given that the database will need to be updated by me pretty regularly)?

  12. #12
    Wnt2bsleepin is offline Senior Member
    Join Date
    Feb 2012
    Posts
    219
    Rep Power
    3

    Default Re: Java, MySQL and Apple Mac computers

    Quote Originally Posted by RedLenin View Post
    That sounds like a brilliant idea because an embedded database would possibly make ongoing maintenance of the program easier than using MySQL. Thanks for coming up with that idea - I hadn't even looked at SQLite before.
    The syntax is a little bit different, but it's very similar to MySQL. It's also a lot easier for people to install and use your program. I don't know what kind of information you want to install in the database, and depending on what it is, it may be easier to use a centralized DB like a MySQL server.

Posting Permissions

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