Hello,
I’ve been trying to create some simple database test application, I’ve been also looking for some tutorials on this topic here, but most of them involves creating the sample data manually (by filling some Collection with sample data statically in code).
what I wanted to ask - is there some tutorial available, which shows the “real” thing - connecting to a DB (I’m using postgres, with connection pool configured as a JNDI resource in Glassfish), fetching the data into some container, displaying it in a table, updating it etc…
Also, which container should I use? (my project will be opensource, so if JpaContainer is a better option, then be it JpaContainer). I know, that Hibernate is a specific implementation of JPA, but there are these two different containers, so there has to be some difference in using them Because I am starting to feel a little bit lost in all those posts, some are reference jpacontainer, others do HbnContainer, each has different method of configuration (in eclipse)… I would really appreciate some step-by-step article with examples that would demonstrate using some *SQL DBMS with Vaadin and doing basic CRUD operations with it.
What I’ve have already done (and would like to do next):
- create a database on Postgres server, along with some test tables, using keys/foreign keys to represent one-to-many relations etc…
- installed jboss tools’ hibernate support into eclipse
- configured JNDI JDBC connection pool on glassfish; configured eclipse to be able to connect to the database
- created Bean classes with Hibernate database reverse engineering plugin
– so, What I need to do next, is to be able to use this to select data from a database and display it in a Table UI component
– be able to update the data on some user event (“submitted” form, or changed cell in the Table itself)
– delete specific rows, insert new rows…
I’ve previously developed some database applications with PHP, where it comes to making a SQL query, fetching the result into an array and somehow display contents of that array with HTML (which is a monkey work, the same thing again and again I started to hate, that’s why I want to switch to Java and Vaadin )
I’ve also looked into JDBC (statements, preparedstatements…). but it seems these containers are something completely different, that (as a concept) have nothing to do with the Statements approach.
Cheers