0

I have been doing a lot of research the past few days but the more info I obtain, the more confused I get.

So far it appears that the Spring Framework will be able to suit my needs, but every example and every tutorial I read implements a webapp rather than a desktop application, even though as suggested by similar topics integration with desktop should be possible:

Can Spring and SWT work together for Java Desktop Applications?

Adding spring mvc to a spring java "desktop" application

and many more; the issue is none of these topics are able to set my thoughts straight.

Basically what I want my desktop app to do is show a login screen (easy, I can make this), then compare the credentials against my mySQL database and start a user session. As the user uses the app I want all the variables the user enters to be stored in my database, but only for that specific user. (I have set up checkboxes, textfields etc.)

So basically my setup would be as follows:

Login Screen -> User1 logs in and is authenticated

Desktop App -> User1 enters and saves some data, the desktop app saves the data in the database for User1

I think I need Spring for this, I just don't know how to combine a session management with data persistence. Any help would be greatly appreciated, I have found no similar topics anywhere.

CoderXYZ
  • 167
  • 2
  • 13
  • 1
    Have you tried *anything* yet? – Gurwinder Singh Jan 01 '17 at 19:40
  • Fair enough! I understand that is a big prerequisite to posting, I just honestly do not know where to start. Most of the time I can find good tutorials, but any and all tutorials are webapp based, so I can't even find any code to implement. I would love to experiment and I don't expect others to write me any code, but just some help to clear my thoughts and just knowing where to start would be awesome. – CoderXYZ Jan 01 '17 at 19:45
  • This isn't really a good fit for Stack Overflow. I'm not sure why Spring is what you need. Seems like a webapp is a solution and the user just hits webpages in the "desktop" app. – Christopher Schneider Jan 01 '17 at 19:50
  • This is very possible. I have googled things such as "Java Desktop mysql data persistence and user login" etc etc, but nowhere can I find a framework that would suit my needs without going through a webapp. Can you point me to the framework i would need for the above stated example? All I need is a name and I can do the research myself – CoderXYZ Jan 01 '17 at 19:53
  • Just as a sidenote, I have tried working with: Spring, Hibernate, and Shiro – CoderXYZ Jan 01 '17 at 20:11
  • Is this login screen part of the desktop app? There's nothing stopping you from having a user login to a desktop app. I doubt it will be terribly useful but here's a little code from a spring tutorial I did a while ago that I can no longer find. You might be able to see the usefulness and if it actually applies to your needs. See [Git repo](https://github.com/ChiefTwoPencils/spring-gradle-example) here. – ChiefTwoPencils Jan 01 '17 at 20:24
  • Here's a question on persistence but with derby. http://stackoverflow.com/a/24824472/2855515 – brian Jan 01 '17 at 22:41
  • See http://stackoverflow.com/questions/40539310/dependency-injection-and-javafx And also https://github.com/james-d/SpringFXExample – James_D Jan 01 '17 at 23:09
  • Also see [Gluon Ignite](http://gluonhq.com/labs/ignite/). Ideally, for the Spring integration you would make the application a [SpringBoot application](https://projects.spring.io/spring-boot/), there is a [demo of JavaFX+Spring Boot](https://github.com/thomasdarimont/spring-labs/tree/master/spring-boot-javafx) (I haven't tried it myself and there isn't a whole lot of info on the net about Spring Boot+JavaFX). Note, you don't *need* Spring for this, you can write a [JavaFX+Database app](https://gist.github.com/jewelsea/4955598) without Spring. – jewelsea Jan 03 '17 at 19:48

0 Answers0