MyBatis Tutorial (A Quick Start Guide)

This brief MyBatis tutorial explains and demonstrates the basics of MyBatis (formerly ibatis).

This tutorial uses MyBatis Version 3.  It will walk you through the four major components you’ll need to have in place to get started:

  • a configuration file — this general configuration holds things like the name of the database, userid and password as well as some other configuration options.
  • java classes that will represent the database tables (models)
  • a mybatis xml file which is called a mapper.  The mapper xml file will contain your queries and an explicit map so the query results know which java class to use.
  • java class which will act as the interface to the xml mapper file

 

Java web services tutorial

Have you ever wondered how to create web services and RESTful API’s with Java? 

In this brief Java web services tutorial you’ll see an example of a web service created from scratch.  Part two demonstrates deploying to a server and testing the web service.  The source code is included below.

Part one:  How to develop & test your Java web service. It is 8 minutes.

 

Part two: Demonstrates deploying the code to a server. It is 3 minutes:

Please leave your comments.  I’d like to know if this tutorial was useful!

Download the source code

Dealing With ‘no bash profile’ error when trying to run phalcon.sh

I recently installed XAMPP, Phalcon.so and Phalcon DevTools on a new MAC. When I tried to run ./phalcon.sh to verify it was installed correctly I received this error:

“no bash profile”

To fix this, I edited my .bash_profile file. I added these two lines to the top of the file:

export XAMPP_HOME=/Applications/XAMPP
export PATH=${XAMPP_HOME}/bin:${PATH}

This tells the MAC to use the PHP version that is a part of my XAMPP install (which includes phalcon.so).

After a restart of the terminal, I was able to run ./phalcon.sh successfully.

Thank you stackoverflow!

phalconphp-com

PhalconPHP 3.0 Tutorial (using XAMPP)

I’m working on a PhalconPHP 3 tutorial.  This tutorial will take you through building and deploying an entire web application.  To hear more about the course join my mailing list.

This is what I have so far:

Course PreReqs:
– You should already have installed a MAMP, XAMPP (or other application) with PHP 5.6

The prework consists of installing PhalconPHP & PhalconPHP dev tools and Composer on a MAC or Windows:

Install PhalconPHP on a MAC
Install PhalconPHP devtools on a MAC

Install PhalconPHP on Windows
Install PhalconPHP devtools on winows.

Install Composer on MAC or Windows

I’m working on the first video tutorial that will explain the structure of the files in a PhalconPHP project.  If you have suggestions for the course or feedback on what I’ve posted so far please email me at michelle@webappdevelopmentlab.com.

Get to know the structure of PhalconPHP projects (3 minute video)

Understanding project folder & file naming conventions (video & files used in video)

A little about the PhalconPHP configuration files

Easy way to install Phalcon PHP when you’re using XAMPP on a MAC

This is the easiest way to install PhalconPHP that I have found.  I’m using XAMPP but it should work with other ‘AMP’ installs, however the path for the phalcon.so file on my XAMPP install is:

Applications/XAMPP/xamppfiles/lib/php/extentions/no-debug-non-zts-20131226

 

If you want to compile it yourself, the instructions below worked for me:

brew install php56-phalcon
git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
git checkout 3.0.x
cd ..
cd ext
./install
....and then copied the phalcon.so file to the xampp folder:
...lib/php/extensions/no-debug-non-zts-20121212
I needed to move to the ‘ext’ directory before the call to install because when I tried to install from the build directory I got this error:
 No such file or directory
…php_smart_string.h
I found this discussion which said to switch to the ext directory…and I did…and it worked! (phew)
Here are the links I used to piece this together:
https://docs.phalconphp.com/en/latest/reference/install.html#id1
https://blog.phalconphp.com/post/phalcon-2-1-0-RC1-released
https://forum.phalconphp.com/discussion/11943/volt-checking-if-assets-collection-exists-breaks-render

 

Also — this is the fastest way I’ve found to install Phalcon PHP development tools on Windows!