BCS Create Django Admin

To create and administration site for you models you must first establish a super user by issuing the following command in the project directory.

python3 manage.py createsuperuser

The results of issuing the command is as follows.

Superuser created successfully is the desired result.

Modify the admin.py in your application directory to reflect the following.

from django.contrib import admin
from .models import Post
 
# Register your models here.
 
admin.site.register(Post)

Start the server and bring up the administration web site.

python3 manage.py runserver

In the browser issue the following command.

http://localhost:8000/admin

When prompted to login use the credentials created when you established the superuser.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Create Django Application

Return to the project location in terminal and issue the following command.

django-admin startapp blog

In the terminal application change directories to current application sub directory.

Modify models.py to define the tables in question.

All the associated field descriptions can be reviewed by clicking here.

After the tables have been defined use the following command to make migrations.

b

python3 manage.py makemigrations blog

The following depicts the output from the command.

We should apply all migrations to the database by issuing the following command.  Return to the project root and issue the following command.

python3 manage.py migrate

The result of the following command is as follows.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Create Django Site with MySQL Backend

For those times when Django site need to support MySQL this tutorial may be helpful.

The first task is to create the Django project. Go to the command prompt and issue the following command.

django-admin startproject mysite

The result may be observed in the following screen shot.

Next we should allow the MySQL connection.  Firs we need to import the MySQL interface by including the two statements below into settings.py for your project.

import pymysql 
pymysql.install_as_MySQLdb()

Next declare the default database description to point to the correct MySQL database by incorporating the following lines.

'ENGINE': 'django.db.backends.mysql', 
  'NAME': 'pblog', 
  'USER' : 'bcs', 
  'PASSWORD' : 'YourPassword', 
  'HOSTS' : 'localhost', 
  'PORT' : '3306',

After the chages are incorporated the resulting settigs.py file reflects the following.

"""
Django settings for mysite project.
 
Generated by 'django-admin startproject' using Django 1.11.8.
 
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
 
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
 
import os
import pymysql
pymysql.install_as_MySQLdb()
 
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
 
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
 
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'r8=&&1s%@60c%&cffq(bb54%_=px-@z=z#(htd!)jo^ny8xy9j'
 
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
 
ALLOWED_HOSTS = []
 
 
# Application definition
 
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]
 
MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
 
ROOT_URLCONF = 'mysite2.urls'
 
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]
 
WSGI_APPLICATION = 'mysite2.wsgi.application'
 
 
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
 
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'pblog',
        'USER' : 'bcs',
        'PASSWORD' : 'YourPassword',
        'HOSTS' : 'localhost',
        'PORT' : '3306',
    }
}
 
 
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
 
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]
 
 
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
 
LANGUAGE_CODE = 'en-us'
 
TIME_ZONE = 'UTC'
 
USE_I18N = True
 
USE_L10N = True
 
USE_TZ = True
 
 
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
 
STATIC_URL = '/static/'

We should start the server to determine the correctness of our configuration.

python manage.py runserver

Notice the server is running at the prescribed location.

The final step to this portion of the process is to migrate the database by issuing the following command.

python3 manage.py migrate

After the migration is successful you should have similar output messages in your terminal session.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Grails 3.x And MySQL

To enable Grails to converse with MySQL in version 3.x a few  configuration changes are required.  Below depicts the default application.yml file.

---
hibernate:
    cache:
        queries: false
        use_second_level_cache: true
        use_query_cache: false
        region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
 
dataSource:
    pooled: true
    jmxExport: true
    driverClassName: org.h2.5.0%2Fdocs%2Fapi%2F">Driver
    username: sa
    password:
 
environments:
    development:
        dataSource:
            dbCreate: create-drop
            url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
    test:
        dataSource:
            dbCreate: update
            url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
    production:
        dataSource:
            dbCreate: update
            url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
            properties:
                jmxEnabled: true
                initialSize: 5
                maxActive: 50
                minIdle: 5
                maxIdle: 25
                maxWait: 10000
                maxAge: 600000
                timeBetweenEvictionRunsMillis: 5000
                minEvictableIdleTimeMillis: 60000
                validationQuery: SELECT 1
                validationQueryTimeout: 3
                validationInterval: 15000
                testOnBorrow: true
                testWhileIdle: true
                testOnReturn: false
                jdbcInterceptors: ConnectionState
                defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
 
---
---
grails:
    profile: web
    codegen:
        defaultPackage: ap01
    spring:
        transactionManagement:
            proxies: false
info:
    app:
        name: '@info.app.name@'
        version: '@info.app.version@'
        grailsVersion: '@info.app.grailsVersion@'
spring:
    groovy:
        template:
            check-template-location: false
# Spring Actuator Endpoints are Disabled by Default
endpoints:
    enabled: false
    jmx:
        enabled: true
 
---
grails:
    mime:
        disable:
            accept:
                header:
                    userAgents:
                        - Gecko
                        - WebKit
                        - Presto
                        - Trident
        types:
            all: '*/*'
            atom: application/atom+xml
            css: text/css
            csv: text/csv
            form: application/x-www-form-urlencoded
            html:
              - text/html
              - application/xhtml+xml
            js: text/javascript
            json:
              - application/json
              - text/json
            multipartForm: multipart/form-data
            pdf: application/pdf
            rss: application/rss+xml
            text: text/plain
            hal:
              - application/hal+json
              - application/hal+xml
            xml:
              - text/xml
              - application/xml
    urlmapping:
        cache:
            maxsize: 1000
    controllers:
        defaultScope: singleton
    converters:
        encoding: UTF-8
    views:
        default:
            codec: html
        gsp:
            encoding: UTF-8
            htmlcodec: xml
            codecs:
                expression: html
                scriptlets: html
                taglib: none
                staticparts: none
endpoints:
    jmx:
        unique-names: true

The modified application.yml file which allows for MySQL connectivity is depicted as follows.

---
hibernate:
    cache:
        queries: false
        use_second_level_cache: true
        use_query_cache: false
        region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
 
dataSource:
    pooled: true
    jmxExport: true
    driverClassName: com.mysql.jdbc.5.0%2Fdocs%2Fapi%2F">Driver
    username: user
    password: password
 
environments:
    development:
        dataSource:
            dbCreate: update
            url: jdbc:mysql://localhost/gra01?useUnicode=yes&characterEncoding=UTF-8
    test:
        dataSource:
            dbCreate: update
            url: jdbc:mysql://localhost/gra01?useUnicode=yes&characterEncoding=UTF-8
    production:
        dataSource:
            dbCreate: update
            url: jdbc:mysql://localhost/gra01?useUnicode=yes&characterEncoding=UTF-8
            properties:
                jmxEnabled: true
                initialSize: 5
                maxActive: 50
                minIdle: 5
                maxIdle: 25
                maxWait: 10000
                maxAge: 600000
                timeBetweenEvictionRunsMillis: 5000
                minEvictableIdleTimeMillis: 60000
                validationQuery: SELECT 1
                validationQueryTimeout: 3
                validationInterval: 15000
                testOnBorrow: true
                testWhileIdle: true
                testOnReturn: false
                jdbcInterceptors: ConnectionState
                defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
 
---
---
grails:
    profile: web
    codegen:
        defaultPackage: ap01
    spring:
        transactionManagement:
            proxies: false
info:
    app:
        name: '@info.app.name@'
        version: '@info.app.version@'
        grailsVersion: '@info.app.grailsVersion@'
spring:
    groovy:
        template:
            check-template-location: false
# Spring Actuator Endpoints are Disabled by Default
endpoints:
    enabled: false
    jmx:
        enabled: true
 
---
grails:
    mime:
        disable:
            accept:
                header:
                    userAgents:
                        - Gecko
                        - WebKit
                        - Presto
                        - Trident
        types:
            all: '*/*'
            atom: application/atom+xml
            css: text/css
            csv: text/csv
            form: application/x-www-form-urlencoded
            html:
              - text/html
              - application/xhtml+xml
            js: text/javascript
            json:
              - application/json
              - text/json
            multipartForm: multipart/form-data
            pdf: application/pdf
            rss: application/rss+xml
            text: text/plain
            hal:
              - application/hal+json
              - application/hal+xml
            xml:
              - text/xml
              - application/xml
    urlmapping:
        cache:
            maxsize: 1000
    controllers:
        defaultScope: singleton
    converters:
        encoding: UTF-8
    views:
        default:
            codec: html
        gsp:
            encoding: UTF-8
            htmlcodec: xml
            codecs:
                expression: html
                scriptlets: html
                taglib: none
                staticparts: none
endpoints:
    jmx:
        unique-names: true

To complete the process the version of MySQL should be specified in the build.gradle file.

runtime "mysql:mysql-connector-java:5.1.40"

The only other caveat is to make the MySQL driver available to the Grails application.

The build.gradle file should be modified to represent something like the following.

buildscript {
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.1"
        classpath "org.grails.plugins:hibernate5:6.0.2"
    }
}
 
version "0.1"
group "ap01"
 
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
 
repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
}
 
dependencyManagement {
    imports {
        mavenBom "org.grails:grails-bom:$grailsVersion"
    }
    applyMavenExclusions false
}
 
dependencies {
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:hibernate5"
    compile "org.hibernate:hibernate-core:5.1.1.Final"
    compile "org.hibernate:hibernate-ehcache:5.1.1.Final"
    console "org.grails:grails-console"
    profile "org.grails.profiles:web"
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.1"
    runtime "com.h2database:h2"
    runtime "mysql:mysql-connector-java:5.1.40"
    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
 
 
assets {
    minifyJs = true
    minifyCss = true
}

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Grails, MySQL and Spring Security

The Grails environment for this example is Grails 3.2.2, Groovy 2.4.7 and JVM 1.8.0_92.

This tutorial will demonstrate how to create a new Grails project, enable MySQL database and Spring Security.  To begin the process create a new Grails project entitled “books” minus quotes.

To review how to accomplish this see the tutorial here.  Next connect the Grails application with MySQL RDBMS by reviewing the tutorial here.

Continue to add Spring security by completing the steps listed below.

BCS Grails Using MySQL RDBMS

The Grails environment for this example is Grails 3.2.2, Groovy 2.4.7 and JVM 1.8.0_92.

To allow Grails to converse with MySQL these following steps should be followed.

First change the build.gradle file to include the MySQL driver as depicted below.

buildscript {
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.1"
        classpath "org.grails.plugins:hibernate5:6.0.2"
    }
}
 
version "0.1"
group "books"
 
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
 
repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
}
 
dependencyManagement {
    imports {
        mavenBom "org.grails:grails-bom:$grailsVersion"
    }
    applyMavenExclusions false
}
 
dependencies {
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:hibernate5"
    compile "org.hibernate:hibernate-core:5.1.1.Final"
    compile "org.hibernate:hibernate-ehcache:5.1.1.Final"
    console "org.grails:grails-console"
    compile "org.grails.plugins:spring-security-core:3.1.1"
    profile "org.grails.profiles:web"
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.1"
    runtime "com.h2database:h2"
    runtime "mysql:mysql-connector-java:5.1.40"
    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
 
 
assets {
    minifyJs = true
    minifyCss = true
}

Next change the application.yml file to describe the connection for the database.

---
grails:
    profile: web
    codegen:
        defaultPackage: books
    spring:
        transactionManagement:
            proxies: false
info:
    app:
        name: '@info.app.name@'
        version: '@info.app.version@'
        grailsVersion: '@info.app.grailsVersion@'
spring:
    groovy:
        template:
            check-template-location: false
# Spring Actuator Endpoints are Disabled by Default
endpoints:
    enabled: false
    jmx:
        enabled: true
 
---
grails:
    mime:
        disable:
            accept:
                header:
                    userAgents:
                        - Gecko
                        - WebKit
                        - Presto
                        - Trident
        types:
            all: '*/*'
            atom: application/atom+xml
            css: text/css
            csv: text/csv
            form: application/x-www-form-urlencoded
            html:
              - text/html
              - application/xhtml+xml
            js: text/javascript
            json:
              - application/json
              - text/json
            multipartForm: multipart/form-data
            pdf: application/pdf
            rss: application/rss+xml
            text: text/plain
            hal:
              - application/hal+json
              - application/hal+xml
            xml:
              - text/xml
              - application/xml
    urlmapping:
        cache:
            maxsize: 1000
    controllers:
        defaultScope: singleton
    converters:
        encoding: UTF-8
    views:
        default:
            codec: html
        gsp:
            encoding: UTF-8
            htmlcodec: xml
            codecs:
                expression: html
                scriptlets: html
                taglib: none
                staticparts: none
endpoints:
    jmx:
        unique-names: true
 
---
hibernate:
    cache:
        queries: false
        use_second_level_cache: true
        use_query_cache: false
        region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
 
dataSource:
       pooled: true
       driverClassName: "com.mysql.jdbc.Driver"
       dialect: "org.hibernate.dialect.MySQL5InnoDBDialect"
environments:
    development:
        dataSource:
            dbCreate: "update" 
            url: "jdbc:mysql://localhost/database?useUnicode=yes&characterEncoding=UTF-8"
            username: "user"
            password:  "password"
    test:
        dataSource:
            dbCreate: update
            url: "jdbc:mysql://localhost/database?useUnicode=yes&characterEncoding=UTF-8"
            username: "user"
            password:  "password"
    production:
        dataSource:
            dbCreate: none
            url: "jdbc:mysql://localhost/database?useUnicode=yes&characterEncoding=UTF-8"
            username: "user"
            password:  "password"
            properties:
               jmxEnabled: true
               initialSize: 5
               maxActive: 50
               minIdle: 5
               maxIdle: 25
               maxWait: 10000
               maxAge: 10 * 60000
               timeBetweenEvictionRunsMillis: 5000
               minEvictableIdleTimeMillis: 60000
               validationQuery: "SELECT 1"
               validationQueryTimeout: 3
               validationInterval: 15000
               testOnBorrow: true
               testWhileIdle: true
               testOnReturn: false
               jdbcInterceptors: "ConnectionState;StatementCache(max=200)"
               defaultTransactionIsolation: java.sql.Connection.TRANSACTION_READ_COMMITTED

Now you should issue the Grails run-app command at the command line as depicted below.

If there are no errors Grails should be conversant with MySQL at this point.  The resulting successful output is depicted below.

The coast is clear for further utilization of MySQL in your grails app.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Data Element Display Label

Each data element has an associated display label.  This application allows the user to update the display label.

dedn01

When the DED Data Entry option is selected the following dialog appears allowing the user to select an existing database and table.

dedn02

Simply double click on the desired data alias and table name to select it.  Once selected the following dialog will appear.

dedn03

The above dialog lists all the data element names for the selected alias and table.  To reveal the display label value simply click on the desired data element name.

dedn04

Simply key in the display label for the data element.  Exit the application by either selecting the exit option or clicking on the “X” in the application menu.

The database structure is listed below.

-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 19, 2016 at 10:17 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
 
51&q=SET&lr=lang_en">SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
51&q=SET&lr=lang_en">SET time_zone = "+00:00";
 
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
 
--
-- Database: `de`
--
 
-- --------------------------------------------------------
 
--
-- Table structure for table `dl`
--
 
51&q=CREATE&lr=lang_en">CREATE 51&q=TABLE&lr=lang_en">TABLE `dl` (
  `id` 51&q=INT&lr=lang_en">int(11) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL,
  `dna` 51&q=VARCHAR&lr=lang_en">varchar(75) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL,
  `lab` 51&q=VARCHAR&lr=lang_en">varchar(125) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL
) 51&q=ENGINE&lr=lang_en">ENGINE=51&q=INNODB&lr=lang_en">InnoDB 51&q=DEFAULT&lr=lang_en">DEFAULT 51&q=CHARSET&lr=lang_en">CHARSET=latin1;
 
--
-- Indexes for dumped tables
--
 
--
-- Indexes for table `dl`
--
51&q=ALTER&lr=lang_en">ALTER 51&q=TABLE&lr=lang_en">TABLE `dl`
  51&q=ADD&lr=lang_en">ADD 51&q=PRIMARY%20KEY&lr=lang_en">PRIMARY KEY (`id`);
 
--
-- AUTO_INCREMENT for dumped tables
--
 
--
-- AUTO_INCREMENT for table `dl`
--
51&q=ALTER&lr=lang_en">ALTER 51&q=TABLE&lr=lang_en">TABLE `dl`
  51&q=MODIFY&lr=lang_en">MODIFY `id` 51&q=INT&lr=lang_en">int(11) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL 51&q=AUTO_INCREMENT&lr=lang_en">AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

A 32-bit executable program may be downloaded by clicking here.
A 64-bit executable program may be downloaded by clicking here.
The component documentation can be found by clicking here.
The source code may be found by clicking here.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Eclipse Neon Data Tools Platform

It is desirable to have the Data Tools Platform available when using Eclipse Neon for the development of software. Make sure the Data Tools Platform is loaded and activated in Eclipse Neon. If the Data Tools Platform is not available use the standard Install New Software process to make it active.

To begin the Eclipse Neon installation process click on the Help option followed by the Install New Software Option.

nin01

Select All Available Sites when the dialog appears.  Traverse to the Database Development option and select it.

nin02

There may be a few prompts but simply select the defaults and the Data Tools Platform will be installed.  When prompted that Eclipse must be restarted before the updates will be applied select the Yes option and Eclipse will restart with the newly installed features available.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Populate Data Label

This application allows the user to populate the MySQL data element display label.  To begin the process click on the Select Data Table option.

depo01

The following dialog will appear.  Simply traverse the list and double click on the desired data table.

depo02

The list of the available data elements appear in the following dialog.  For new data elements not found in the repository and new entry is made simultaneously.  The repository is designed for unique data elements names only.  For our purposes duplicate data names are not allowed.

depo03

Click on the desired data element to invoke the edit dialog.

depo04

Only the Label Field in this dialog may be modified.  All other fields are read only.  This process may be repeated until you are satisfied the the data element labels for you tables reflects the correct label information.

The repository is listed below.

-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 30, 2016 at 03:09 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
 
51&q=SET&lr=lang_en">SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
51&q=SET&lr=lang_en">SET time_zone = "+00:00";
 
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
 
--
-- Database: `de`
--
 
-- --------------------------------------------------------
 
--
-- Table structure for table `dl`
--
 
51&q=CREATE&lr=lang_en">CREATE 51&q=TABLE&lr=lang_en">TABLE `dl` (
  `id` 51&q=INT&lr=lang_en">int(11) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL,
  `dna` 51&q=VARCHAR&lr=lang_en">varchar(75) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL,
  `lab` 51&q=VARCHAR&lr=lang_en">varchar(125) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL
) 51&q=ENGINE&lr=lang_en">ENGINE=51&q=INNODB&lr=lang_en">InnoDB 51&q=DEFAULT&lr=lang_en">DEFAULT 51&q=CHARSET&lr=lang_en">CHARSET=latin1;
 
--
-- Indexes for dumped tables
--
 
--
-- Indexes for table `dl`
--
51&q=ALTER&lr=lang_en">ALTER 51&q=TABLE&lr=lang_en">TABLE `dl`
  51&q=ADD&lr=lang_en">ADD 51&q=PRIMARY%20KEY&lr=lang_en">PRIMARY KEY (`id`),
  51&q=ADD&lr=lang_en">ADD 51&q=UNIQUE&lr=lang_en">UNIQUE 51&q=KEY&lr=lang_en">KEY `dna` (`dna`);
 
--
-- AUTO_INCREMENT for dumped tables
--
 
--
-- AUTO_INCREMENT for table `dl`
--
51&q=ALTER&lr=lang_en">ALTER 51&q=TABLE&lr=lang_en">TABLE `dl`
  51&q=MODIFY&lr=lang_en">MODIFY `id` 51&q=INT&lr=lang_en">int(11) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL 51&q=AUTO_INCREMENT&lr=lang_en">AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

A 32 bit executable program may be downloaded by clicking here.
A 64 bit executable program may be downloaded by clicking here.
The component documentation can be found by clicking here.
The source code may be found by clicking here.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

BCS Compile Delphi Projects

This application tracks Delphi project with a MySQL database. When the user double clicks on the project grid the IDE is launched.

cdp01

The data entry portion of the application is depicted below.

cdp02

The data structure is listed here.

-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 08, 2016 at 01:02 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
 
51&q=SET&lr=lang_en">SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
51&q=SET&lr=lang_en">SET time_zone = "+00:00";
 
--
-- Database: `dcp`
--
 
-- --------------------------------------------------------
 
--
-- Table structure for table `dp`
--
 
51&q=CREATE&lr=lang_en">CREATE 51&q=TABLE&lr=lang_en">TABLE `dp` (
  `id` 51&q=INT&lr=lang_en">int(11) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL,
  `proj` 51&q=VARCHAR&lr=lang_en">varchar(150) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL,
  `sdes` 51&q=VARCHAR&lr=lang_en">varchar(150) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL,
  `ddes` 51&q=MEDIUMTEXT&lr=lang_en">mediumtext
) 51&q=ENGINE&lr=lang_en">ENGINE=51&q=INNODB&lr=lang_en">InnoDB 51&q=DEFAULT&lr=lang_en">DEFAULT 51&q=CHARSET&lr=lang_en">CHARSET=latin1;
 
--
-- Indexes for dumped tables
--
 
--
-- Indexes for table `dp`
--
51&q=ALTER&lr=lang_en">ALTER 51&q=TABLE&lr=lang_en">TABLE `dp`
  51&q=ADD&lr=lang_en">ADD 51&q=PRIMARY%20KEY&lr=lang_en">PRIMARY KEY (`id`);
 
--
-- AUTO_INCREMENT for dumped tables
--
 
--
-- AUTO_INCREMENT for table `dp`
--
51&q=ALTER&lr=lang_en">ALTER 51&q=TABLE&lr=lang_en">TABLE `dp`
  51&q=MODIFY&lr=lang_en">MODIFY `id` 51&q=INT&lr=lang_en">int(11) 5.1/en/non-typed-operators.html">NOT 51&q=NULL&lr=lang_en">NULL 51&q=AUTO_INCREMENT&lr=lang_en">AUTO_INCREMENT;

A 32 bit executable program may be downloaded by clicking here.
A 64 bit executable program may be downloaded by clicking here.
The component documentation can be found by clicking here.
The source code may be found by clicking here.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.