Posts

Showing posts with the label DB

Java DB queries - All of the Options (2014)

When you want to query a DB in java, you have two main options to go: 1. Straight forward queries to the DB This is the most intuitive (imho), just write down the query you want and get the results from the DB. The most notable downside to this method is that you pollute your code with sql queries which can be all over the code, so there is no "one point of change" to the queries, which makes it very hard to change the DB schema for example. 2. ORM style queries This way requires more work to begin qurying the DB but then you use java objects instead of queries so you keep your code clean. You also are able to separate your model from your controller thus change your DB schema with much less pain. Which ORMs exist? Many, while the most notable ones are hibernate (which was the first afaik) & eclipse/total link. But most ORM are not only a third party library (like hibernate when it began) but are now part of JEE implementation of the ...

Amazing PHP site generator

Let's say I have a Database with data. Now, lets assume I want to have a site around this database, which users and admins can access and have access to the data using nice GUI'd tables with the specific data I want each group to be exposed to. When I think of designing such a site, I think of the following requirements: The site must be lightweight , there is no need for any heavy "Engine" here. The site should be built using good coding practices, so I want it to have an MVC engine. I want not to worry about the sql queries, I want not to worry about sql injection, I want DB schema changes to be minor (coding wise) in short - I want an ORM . I want some CRUD functionality I want a nice GUI which means using a lightweight Templating system like Smarty which will preferably use great JS libraries , Twitter Bootstrap, font Awesome etc . One would think I am asking for too much - well, nothing is too much, it just will take a lot of time to develop th...