# Connecting to a MySQL Database from Codename One Part 2: Pure Java

DevFeed: [Connecting to a MySQL Database from Codename One Part 2: Pure Java](<https://devfeed.tech/articles/connecting-to-a-mysql-database-from-codename-one-part-2-pure-java-19267.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/connecting-to-a-mysql-database-part-2/>)

Author: Steve Hannah

Published: 2016-11-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [MySQL](<https://devfeed.tech/topics/mysql.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Java](<https://devfeed.tech/topics/java.md>), [App](<https://devfeed.tech/topics/app.md>), [container](<https://devfeed.tech/topics/container.md>)

Tags: [container](<https://devfeed.tech/tags/container.md>), [database](<https://devfeed.tech/tags/database.md>), [java](<https://devfeed.tech/tags/java.md>), [mac](<https://devfeed.tech/tags/mac.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [windows](<https://devfeed.tech/tags/windows.md>)

## AI overview

This tutorial explains how to connect a Codename One app to a MySQL database using a Java web service layer. It uses NetBeans, GlassFish, XAMPP, and the Sakila sample database, with the app focused on contact information.

## Source excerpt

In my last post I demonstrated how to integrate a MySQL database into a Codename One app using Xataface as a web service layer. In this installment, I'm going to demonstrate how we can build an equivalent app using a Java web service layer. Requirements For this tutorial, I'll be using NetBeans 8.1 and its bundled GlassFish 4.0 container. If you don't already have a MySQL database set up, then I recommend you install XAMPP XAMPP, as it provides a double-clickable installer for Mac and Windows and an easy administration console.