I've tried searching for similar questions here and I don't think I've found anything that matches what I'm looking for. I would like to know where to start in developing a (most likely) database-driven Java application that could keep track of customers, invoices, and quotes for my dad's auto shop. There will be a couple computers in the shop that will need access to it.
I was thinking of having a server in there to handle the database and let whatever machines need to access it use a client app.
Almost all of my experience is in a LAMP environment but I have been trying to learn as much as I can about Java and feel pretty comfortable playing with it in Netbeans or Eclipse.
I'm not asking anyone to tell me how to make it or anything. I would just like to know where to start learning. Is MySQL a good match with Java or should I use something else? I've been wanting to learn Java and I figured this would be a good project to learn on but everything I read seems to give only bits and pieces of what I want to know.
Java and MySQL work well together. Here are some things I would recommend to get started:
JDBC (Java Database Connector) - use it to connect to MySQL
Swing programming - used to create the GUI front end that users will interact with. While NetBeans has a drag and drop GUI builder interface, actually understanding what's going on under the hood is very important.
GlazedLists is a great project for showing dynamic content in table format, such that you can easily filter, sort, etc. Given you will probably have table views of customers, etc., I would look into this
If I were you I would definitely set the bar a little bit lower and try some easier projects to start with (ones that do not require database connectivity, for instance). Once you're a little more advanced with Java, then I'd start work integrating a MySQL table with your app.
I think that most of the answers to this question will prove useful as a starting point
You'll never find a complete subject list to learn java or any other tecnology, I suggest that you should start by writing down the requirements for the project and start "trying/failing" at what you want to do. Bits and Pieces are a very good way to learn.
You could try building different test applications, to get the feel of java, and slowly start using all parts needed to build your application. Common concepts used in small database-driven Java applications are:
JDBC, a java database connector
A client/server architecture (needed if multiple clients need to keep their data synchronized)
Synchronization
A swing GUI
A learning path that worked for me was:
Build a command-line driven java application
Build a test application with a graphical user interface (GUI).
Build a test application with a client/server architecture, but with only one client
Build a test application with a client/server architecture, connect multiple clients and keep them synchronized.
Build a java application with a JDBC database connector, set up a MySQL server and connect the server in your client/server architecture to it.
You can search for each of the concepts on the internet. It should be easy to find tutorials that will teach you how to use them.
MySQL should work well with Java.
In any case, if you use JDBC (a generic API to access SQL databases, part of the standard Java library), you should be quite independent of what underlying database you are using (apart from vendor-specific SQL extensions).
Related
I am experimenting with OpenDolphin after a while of being interested in it's concept,
I am at the defining requirements phase with some friends for a project we want to make with hopes of earning some money from it this project's concept will be based on a server/multiple-client model where we want the server to have most of the logic, we have average to little experience couple of years each doing java projects but not anything big or exactly with the latests tools, so we struggled a little bit understanding the building process of the gradle setup, and after running this project, we are now faced with tons of groovy projects demos.
And I am struggling to keep my friends interested in the library as they think using what we know best is a better option than trying to understand a library that would mean to learn asap a new language
(we are not that lazy but there is some people that is helping us as consultants/associates and we are afraid that if we dont start producing something we are gonna lose their support [we are not earning anything from this yet but without them as "productowners", we wouldnt know what are exactly the market needs]).
I have watched multiple videos and videos like this: http://www.youtube.com/watch?v=z54hEJvpZys
are amazing , I think that is exactly what we need.
I would like to know if maybe there is an example/tutorial in java maybe a screencast,blog or recorded webinar of how to make a simple application where the server binds to a port and multiple java clients update the value and sends a pair of commands.
I dont know something like server starts, puts a default value in a variable, client connects and sees value, second client connects sees value, and a command is sent to server "erase", and both clients see that the server erased it and another command is sent "default" and server sets variable to default.
I am not asking for that exact example but something that I can read to make it like that.
I tried making something like that using the .8 release and I was utterly lost, but i think that an easy example like that could help me to make them see how good of a tool this is,
"Install this in your laptop, that's the server run it and see how my client and yours are synched automagically".
Ok, you made a good choice of technologies :-)
It appears that the Dolphin JumpStart project (https://github.com/canoo/DolphinJumpStart) covers exactly that combination: OpenDolphin with Java, view in JavaFX, built with Gradle (use dist/jumpstart-gradle.zip) and jetty as the minimal server implementation.
The Jumpstart project is also explained in a step-by-step fashion as part of the OpenDolphin user guide (http://open-dolphin.org/download/guide/guide/howto.html).
Concerning your question about the shared tacho demo: this demo is using only one server that all clients connect to. The "clients" update each other over the server-side event bus. To that end, we do not open any specific sockets. It is all plain HTTP POST that goes trough all proxies and firewalls and needs no special infrastructure.
your concerns are very understandable.
First let me clarify that you can use Java, Groovy, JavaScript or any other language that runs on the JVM with OpenDolphin. What would be your preferred language for a demo?
For a demo that shows many clients that share a common value, I would recommend the SharedTachoDemo.
As for making the build setup easier, we do have to make choices in the demos since there are so many combinations of build system (ant, maven, gradle), structure (all-in-one, multi-project), implementation language, IDE integration (intellij, netbeans, eclipse), server infrastructure (jetty, tomcat, grails, glassfish, jboss, weblogic, webshpere, ...), and last not least the intended UI toolkit (Swing, JavaFX, HTML5, others). If you tell me your preferred combination, I can point you to the respective resource or create one for you.
cheers, Dierk
First of all, I'm sorry for a long explanation.
I need to develop a desktop app that will enable users to enter patients lab results for tracking diabetes treatment.
I usually code in php/mysql, but I'm not allowed to use it (my first choice was to use LAMP / XAMPP, but was told not to do so). I was told to use MS Access, as the easiest tool, but since I've never used it before, it gave me a lot of headache. Its wizards are great, but I needed to use data from several tables in my forms, and was simply unable to efficiently do so.
So, here is my question: What sort of db can I use with Java to create such an Application? As I said, I'm most comfortable with PHP/MYSQL combination, but during my studies I also used Java quite a lot. If I could find some sort of 'template' for such an application, I could probably create this easily.
I found this http://netbeans.org/kb/docs/java/gui-db.html using google. How complicated is this?
I need to create this ASAP, since I need to get this App to a team of medical staff, since I need this data to use as datasets for my MSc thesis (related to case based reasoning). I'm really behind schedule here :). And someone will probably break my neck if I don't develop it in a few days and start working on a theoretical part of my thesis.
Thank you in advance.
Okay, this one is near and dear having just been diagnosed as pre-diabetic.
What's not completely clear from your description is if you are keeping a separate database for each instance of the app, or are you sharing the data in one big remote database?
And how much data are you expecting?
If it's just for each instance, then any old database will work; the lightest weight one is actually probably sqlite3, but since you're in a hurry and used to LAMP, mysql will certainly work.
For remote data, go with mysql.
Either way around, there are plenty of ways to connect to the database, most all of them based on JDBC. It seems like you basiucally need two tables: patient, and labs. Patient will be something like <name,dob,ssan,address>, and labs something like <ssan, labtype, value, units>. SSAN would be the key and a record would be something like
123-45-6789|A1C| 6.0|pct glucolated
In that case, I'd just make the tables, have two forms with the data, and don't try for anything too fancy.
Update
Okay, from your comments, yes, either use Derby or just use text files. Do you need any particularly complicated queries? In the Old Days we would just have made something like a CSV file and read it into memory.
Oh, and look into Java Web Start for distributing the app.
You can use Java to connect to a database via JDBC. Check out this tutorial. http://download.oracle.com/javase/tutorial/jdbc/index.html. You can use mySQL as your database. You can also use embedded databases such as derby which don't require an external database application.
Here are 2 tutoriala how to build CRUD application on top of the NetBeans Platform (a Swing-based RCP):
http://platform.netbeans.org/tutorials/nbm-maven-crud.html
http://platform.netbeans.org/tutorials/nbm-crud.html
Suppose i have one website with simple pages in php like
page1.php
page2.php
Now there is one page where i want some detailed functioning and i want to use python for that and it will look like
page3.py
and in other page i want to use java like
page4.jsp
Provided i have installed python , java on webserver.
Is it possible?
Yes. It's possible. Where you will find yourself in trouble is when you want to share server-side information among them (I.E. sessions).
Other than that, you can use (but I would advise against it) all languages you want on a website.
Yes, it is possible, but you definitely should NOT do it.
Communication between pages running different technologies will not be elegant, if for no other reason than the fact that you won't get a shared session pool. Session bridges are possible, but they are a pain to do.
I would say you are making a mistake if you can't just pick a single language for your core web layer.
Yes it is very possible, as long as the server can serve the files you want to use. If it doesn't have python, you can't use python.
It depends on the web server. Apache can do it. Just make sure you have the appropriate handler modules for each file type, and use the AddHandler configuration directive to map each type to the appropriate handler.
Also, to be pedantic, you can not only use all three of those, but you can actually integrate them at the session level, since all of those languages are available on the JVM. So, in one container you can run all of the PHP, Python, and Java code. You can share session state, reuse connections to the database (via server wide connection pools), leverage Java libs in your PHP and/or Python code, etc.
I'm not saying this will be "drag and drop" easy, but it is possible, and even practical if you need that kind of close integration (vs integration via a database or filesystem). There will likely be nuances in ensuring that the Python and PHP code runs properly on the Java implementations as well.
Short answer: Yes, many web servers can handle generating pages from multiple languages.
People are talking about session...
Almost all server side technologies today support custom session providers, where you can hook up some code to share you session between different HTTP modules and binders.
If you are starting to write a web site from scratch, and you need to write all of your code for yourself, than probably you will choose to do it in one programming language (only for your comfort of coding).
But... where it's all starting to change? When you want to mash-up some open source and community source code to make a web site. Let's say a store & community with ASP.NET to mix up with CRM like Sugar CRM (which is in PHP).
In that case you don't need any session sharing, just users sync procedure in the DB.
Also, if you choose IIS 7 (Windows Server) or Apache (using Mono project you can run ASP.NET on LAMP), you could run them both on the same machine.
And remember, the most important thing is TIME TO MARKET! So saving code time can be crucial for you success.
ENJOY!
I work for a PHP development company and all the time these ASP.Net companies come to US for whatever reason I've never understood. We build them forms in PHP usually dynamically pulling in the layout - sometimes hosted on a subdomain, sometimes hosted directly in IIS with the PHP module. Its very messy and bad, it can be done but I'd say avoid it.
You can use Apache Reverse Proxy to do it and session must be readable between programming languages. I use Go, NodeJS and PHP in one website. Session is saved in Postgresql. The hardest part is all programming that is used in your website can read session with same format and saved in same place. I have used github.com/yvasiyarov/php_session_decoder to read and save session with Go and save it in Postgresql so PHP can process that session
I've got an application here that I wrote many years ago that consists of a heavy-weight front end that directly queries a database server. This application runs on about 7 dedicated workstations. There is also a web-based front-end that I whipped up that shares the same feature set, and a web-based administration too for managing and reporting on the data -- they all just hit the database directly.
The application is quite simple and I understand the problem it solves very well. It could use an update, and I don't even have access to the tools necessary to work on the GUI anymore. I've been getting into Java lately, and it seems like a rewrite of this app would be a good project to get started with.
So my question then is this:
The application will require a non-web GUI, I suppose in Swing. This is necessary for very particular reasons. The application will also require a web-based GUI with the same exact features as the Swing front that will probably be deployed as a JSR-168 portlet, and a web-based administration tool (portlet also). With my previous design I ended up with a lot of duplicate code because each component had its own code base, and I foolishly used stored procedures to help to ensure that critical calculations were at least consistent.
Where should I start? I'm having such a hard time wrapping my mind around how this should all work in the Java world. I guess what I'm having the hardest time with is how do I create an application that can have both a Swing (or whatever) front-end and a web-based front end with as little duplication as possible?
Edit: I know conceptually how this can work. What I'm asking is for advice specifically related to Java technologies. Which frameworks to consider, etc.
Build a Core that contains the business logic. Use JDepend or a similar tool to ensure that it nowhere references anything swing or anything web/jsp/servlet.
Build the two UIs: For the web version pick a webframework of your choice and call your business logic from there.
For the Swing framework you have two options: access the businesslogic through webservices (you could use RMI or whatever, but I wouldn't), i.e. the logic is on the same webserver that serves the webapp (I'd probably prefer that). The alternative is to ship the weblogic with a swing GUI. Makes the coding and debugging easier, but now you have multiple points that access the db which causes headaches when you want to use caching
In any case you should only duplicate the gui stuff, once in html/css/javascript and once in swing.
Congrats on that project it will teach you tons about design and software architecture
You should have a project with all business logic.
Then, 2 separated projects, 1 for the web access, and 1 for the Swing application. those projects both calling the business logic API.
in these 2 projects, have only presentation code
Use a middle tier server.
Swing Client -> middle-server with spring-remoting -> database
Web Client -> middle-server with spring-remoting -> database
Web Client write once any MVC framework will work stripes, struts, even grails if you are brave rememder to keep it thin....
Swing Client write once using miglayout, and glazelist.
http://www.miglayout.com/
http://publicobject.com/glazedlists/glazedlists-1.8.0/
take a look at this posting.....
Java Swing: Libraries, Tools, Layout Managers
Middle-server write once using jdbc cause you have the db already..
http://www.springsource.org/
database write once using whatever you like. It seems already have this....
Obviously start with a unified code base. You might also want to consider whether you really do need multiple interfaces.
You want to make sure that your code does not have unnecessary dependencies. For instance, make you UI as shallow as possible, rather than the usual ball of mud. Avoid singletons, as they cause dependency hell.
It may seem very enterprisey to have a middle tier, but it also adds a lot of work. For a small group it is entirely pointless.
Does anyone have links and resources to connect to an AS400 from Java?
I remember years ago, somebody told me about a connector that simulates KeyStrokes from the keyboard and other "purest" approach that connected directly.
On the web I have found a lot of links, but I cannot find a complete product to do this (I am probably not using the right keywords).
EDIT
Thanks for the answers:
What we are looking for is a way to access the data inside the AS400 and/or the screens it uses and expose them for other new applications re-use. Either as a webservice of some sort, or directly through Java ( and java will expose the operations using webservices )
Thanks in advance.
EDIT
As per MicSim post, I've also found this link:
http://www.ibm.com/developerworks/library/ws-as400/index.html
What you are looking for is probably the Toolbox for Java™ & JTOpen from IBM. There is also an AS400 class in the toolbox for performing specific AS400 tasks. You can look here and here for more details. Just googled it and hope it's helpful.
IBM's 5250 screen-scraping technology was "WebFacing" - I would post a link but you're probably better off Googling it, since IBM's documentation is so scattered. There are other technologies available too but: Screen-scraping was never anyone's favourite since typically you end up with something which, although it looks more up-to-date, actually is harder to use than a green screen and no more functional. The 5250 is probably the single best data entry platform I've ever used - web forms in a browser are one of the worst.
As mentioned, jt400 is the way to go for most other things. In particular:
JDBC - for all things SQL. If you do it right and address your files as though they really are tables, it's a way to get away from the 400 entirely.
Record-level access - write Java programs using a similar database API to RPGLE (all those chains, setlls that 400 programmers love)
Call programs, system commands, manage resources (data queues, data areas, prints / spools, jobs etc etc)
Good luck
If you just want to run Java on the AS/400 (or iSeries, or System i, or whatever IBM's marketing department has decided to call it this month), that's a supported language. You can access the pseudo-DB2 database directly. Or are you after some other form of integration?
This obviously depends on what you want to do, however if you want to simulate keystrokes across a network connection to an AS400 process then Expect4j may be the library you are looking for.
This is generally a really nasty hack though and there are frequently better ways to achieve your goals. What are you trying to do?
The expect4J library can be found here. Expect was originally a unix command that allowed you to specify a string that you are expecting to see and then a string of characters to return. It was frequently used for automating logins etc and for screen-scraping applications.
Even better is the TN5250j Console, which can be used to extract data from the AS/400.
jacada makes tools to do what your looking for
http://www.jacada.com/