Home » Tag Archives: SQL

Tag Archives: SQL

There is no Such Thing as Object-Relational Impedance Mismatch

software-development-2-logo

Much of the ORM criticism of the last decade missed the point, being inaccurate. By the end of this article, we will conclude with the following: There is no significant difference between the relational (data) model and object oriented models How to come to this conclusion? Read on! How we came to believe in this fallacy Many popular bloggers and ...

Read More »

Divided we Stand: Optional

software-development-2-logo

Our recent article “NULL is Not The Billion Dollar Mistake. A Counter-Rant” got us a lot of reads, controversial comments, and a 50/50 upvote / downvote ratio pretty much everywhere a blog post can be posted and voted on. This was expected. Objectively, NULL is just a “special” value that has been implemented in a variety of languages and type ...

Read More »

Use stored procedures with Hibernate

jboss-hibernate-logo

This article show different ways to call stored procedures from hibernate. JDBC actions will not be covered. Postgresql will be used as a database. CREATE DATABASE example; CREATE TABLE company ( company_id BIGSERIAL PRIMARY KEY, name TEXT NOT NULL ); CREATE TABLE benefit ( benefit_id BIGSERIAL PRIMARY KEY, name TEXT, company_id BIGINT, CONSTRAINT fk_company FOREIGN KEY (company_id) REFERENCES company (company_id) ...

Read More »

Setting PostgreSQL psql Variable Based Upon Query Result

postgresql-logo

When using PostgreSQL‘s psql command-line tool to interact with a PostgreSQL database via operator interaction or script, it is not uncommon to want to set psql variables based on the results of a particular query. While PostgreSQL’s procedural language PL/pgSQL supports approaches such as SELECT INTO and assignment (:=) to set PL/pgSQL variables based on a query result, these approaches ...

Read More »

Procedure-Like Functions in PostgreSQL PL/pgSQL

postgresql-logo

PostgreSQL does not support stored procedures in the sense that a database such as Oracle does, but it does support stored functions. In this post, I look at a few tactics that can make the use of a stored function in PostgreSQL (stored function and its calling code both written in PL/pgSQL) feel like using a stored procedure. These simple ...

Read More »

Common SQL Clauses and Their Equivalents in Java 8 Streams

java-logo

Functional programming allows for quasi-declarative programming in a general purpose language. By using powerful fluent APIs like Java 8’s Stream API, or jOOλ’s sequential Stream extension Seq or more sophisticated libraries like javaslang or functionaljava, we can express data transformation algorithms in an extremely concise way. Compare Mario Fusco’s imperative and functional version of the same algorithm: Imperative vs. Functional ...

Read More »

Mysql versions prior to 5.7 do not fully support two phase commit

mysql-logo

While doing some tests for the recently released generic JCA adapter which is capable of binding remote calls to microservices (as well as other things) into JTA transactions, I discovered a bug in Mysql 5.6 which has been around for nearly ten years. The test scenario was a crash after the “prepare” phase of the XA transaction, after both the ...

Read More »

NULL is Not The Billion Dollar Mistake. A Counter-Rant

software-development-2-logo

A short while ago, I gave this answer on Quora. The question was “What is the significance of NULL in SQL?” and most of the existing answers went on about citing C.J. Date or Tony Hoare and unanimously declared NULL as “evil”. So, everyone rants about NULL all the time. Let me counter-rant.     Academics Of course, academics like ...

Read More »

The Evolution of Database Schemas using SQL + NoSQL

nosqlunit-logo

Part two of the two part series: Rethinking Database Design with Apache Drill In part one of this series, Drilling into Healthy Choices we explored using Drill to create Parquet tables as well as configuring Drill to read data formats that are not very standard. We also explored the USDA National Nutrient Database by writing some different queries in Drill. In part ...

Read More »

MySQL vs. MongoDB: Choosing a Data Management Solution

software-development-2-logo

Table Of Contents 1. Introduction 2. The dominance of RDBM systems 3. A new era of NoSQL movement 4. Tables vs Documents vs Graphs vs Key/Values 5. MySQL and MongoDB: Conscious Decision 5.1. Enforced Schema vs Schemaless 5.2. Normalization vs Duplication 5.3. Relations vs References 5.4. Transactions vs Atomic Updates 5.5. SQL vs JSON 5.6. Stored Procedures vs Scripting 5.7. ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.