Showing posts with label MariaDB. Show all posts
Showing posts with label MariaDB. Show all posts

Thursday, June 6, 2013

Our Database: Dropping MySQL for MariaDB

This is part 2 of my Resteasy Tapestry with AngularJS tutorial. We will be fleshing out the database that we will be using for this tutorial/project.

I will be using MariaDB in this. I could use MySQL but ever since Oracle took it over, I've been slightly uncomfortable in using/recommending it. Besides, MariaDB is a drop-in replacement, so any code you wrote (or will write) for MySQL will be OK with a MariaDB database.

As not to be bogged down by database design details, we'll just have a 1 table database for Contacts.

As for our management tool, we will be using Netbeans. Yes, Netbeans. (I'll let that sink in.)

You can manage your MariaDB database in Netbeans just by registering it and running queries against it. And it does have a few GUI features like a 'Create-Table' wizard. To register your MariaDB database(I'm assuming that you have Netbeans and MariaDB installed already) do the following:


  1. Download the java-client driver  
  2. In Netbeans, go to the "Services" tab, right-click on it and select "New Connection"
  3. Pick new driver
  4. On the new window, locate the java-client driver you just downloaded
  5. Set the driver class to: org.mariadb.jdbc.Driver
  6. Pick a name for this new connection
You should be then able then to connect to your MariaDB instance. To test, try executing the command:

create database tangledb;

That should execute without a problem. As for creating a "Contacts" table, that should be fairly straight-forward. Just open up the new tangledb database and on the table folder, right-click and add new table.

As for the columns:
- id (integer, pk)
- firstname (varchar(50), nullable)
- lastname (varchar(50), nullable)
- nickname (varchar(50), not nullable)
- birthday (date)
- mobile (varchar(15), nullable)
- landline (varchar(15), nullable)
- e-mail (varchar(150), nullable)

Click OK and there you have your MariaDB database.

Monday, May 6, 2013

Not your older brother's XAMPP stack

Let's face it, web development has a lot of moving parts: web server, database, various libs and PHP as programming language. And if you're on Windows then your doing it in hard mode. 

I've been using XAMPP but I getting bored with Apache and MySQL. It's time to use something else, learn something new. Who knows, it might be helpful down the road in trolling someone. This is where I found out about WPN-XM. It's an abbreviation of something pretty long, just read about it on their website.

WPN-XM which is the same as XAMPP except it uses Nginx instead of Apache and MariaDB instead of MySQL and it even has MongoDB. Think about it, MariaDB and MongoDB all in a single dev stack. It also have a few tools that any PHP5 programmer will appreciate like Webgrind and XDebug.

This should be interesting.