Bruno Raljić

A Java Developer's Blog

How to create customized CSV files directly from MySQL query results

images

In one of my previous articles, I described how to import data from CSV file into MySQL and now I’ll show you how to export it into the CSV file directly, as a result of query execution. First, let’s start with the basics. Here is the syntax for creating CSV file with some optional parameters […]

, ,

Configure Spring with Hibernate – Basics – Part 2

spring-hibernate

Ok, I will continue with the Spring-Hibernate configuration I’ve started in my previous post. Part 2 will also continue in the Exception Driven Write Style manner. It also means that I’m configuring my project as I’m writting this post. Short description In short words, I’ll create one model class, service, DAO, few servlets and make […]

, , , , , , , ,

Configure Spring with Hibernate – Basics – Part 1

spring-hibernate

Usually, when I write about something, I like to have a short briefing about the topic. But, that’s not the case this time. I don’t think some of you came here after typing “What is Spring/Hibernate” into google. Instead, I think you already have the idea what both Spring and Hibernate are and you just […]

, ,

Import data from CSV files into MySQL

images

When I got this task (importing data from csv into database) for the first time, my reaction was – “OK, I’ll transform the data into one big insert statement, with a bit help of regex and execute it”. And, indeed, I did it that way. Shortly after that, Nikola Cakarevic showed me how to import […]

, , ,

How to rename a large number of files using Java

images

Use case Imagine you have about 20 folders and each folder has 50 – 100 pdf documents in it. Pdf file names have similar structure, let’s say year-month-user_id.pdf e.g. 2012-oct-396.pdf. If, for some reason, user_id has changed, perhaps after a db migration, you’ll need to edit the names of all pdf files in order to make […]

, , , ,

AJAX with Spring MVC

ajax_logo

As I continued to explore the world of Spring MVC, I wondered how the AJAX calls are handled and I found it to be very simple. I’ll present you a simple example, including a little bit of jQuery, JSON, twitter4j etc. Example description Let’s say we want to display specific tweet on our page. User […]

, , , , ,

How to exclude css and js files from Spring MVC dispatcher mapping

After setting up basics for the Spring MVC dispatcher, I included the CSS file but without any results. First I thought the path isn’t declared correctly (I used relative path for the first time). Then I tried with contextPath: but still no changes on the page. After I tried to access this css file directly […]

, , , ,

Setting up git with eclipse step by step

git repo view

This is the step-by-step article for setting up your eclipse to work with git repositories. I’m writing this for myself to use as a reminder later, because it’s the first time I set up git with eclipse. If you see I’m doing something wrong, please let me know. Set up eclipse and plugins I chose […]

, ,

Carbon 5 – How to keep track of executed SQL scripts

If your application use a database and you often execute scripts manually (extending tables with new fields, adding new values) you need to keep records which scripts are executed and which aren’t. Keep in mind that you usually have more than one database (localhost, one or many production databases) and in addition, there are several […]

, ,

How to send tweets from Java

12-Java-and-Twitter

After finishing mongoDB course, my colleague (Nikola Cakarevic) and I decided to build up a small project that will combine Spring (Spring MVC and Spring Data) and mongoDB. Since the Twitter fits in the whole Big Data story, we decided to base our project on it. Yesterday I found some free time to see how […]

, , ,

Previous Posts