The Database Group The Database Group David Hockenberry David Hockenberry Brian Ge Brian Ge Paul Juckiewicz Paul Juckiewicz Logan Everett Logan Everett Laurel Andersen Laurel Andersen Di Zhang Di Zhang
Dec 21, 2015
The Database GroupThe Database Group
David HockenberryDavid Hockenberry Brian GeBrian Ge Paul Juckiewicz Paul Juckiewicz Logan Everett Logan Everett Laurel AndersenLaurel Andersen Di Zhang Di Zhang
Overall Database Overall Database Responsibility (Migration from Responsibility (Migration from
Access to MySQL)Access to MySQL)
By David HockenberryBy David Hockenberry
ResponsibilitiesResponsibilities
Migration from Migration from Access to MySQLAccess to MySQL
Preserve existing Preserve existing Microsoft Access Microsoft Access databasedatabase
Supply support to Supply support to database group database group membersmembers
Microsoft AccessMicrosoft Access
Access is a Relational Database Access is a Relational Database Management toolManagement tool
Bundled with Microsoft OfficeBundled with Microsoft Office
Best selling database in the worldBest selling database in the world
Microsoft platform dependentMicrosoft platform dependent
MySQLMySQL
MySQL is a Relational Database MySQL is a Relational Database Management System (RDMS)Management System (RDMS)
FreeFree
Most popular open source database in the Most popular open source database in the worldworld
Platform independentPlatform independent
Why use MySQL?Why use MySQL?
Many different solutions: SQL Server, Oracle, Many different solutions: SQL Server, Oracle, DB2, Sybase, etc… Why MySQL?DB2, Sybase, etc… Why MySQL?– Fast – According to MySQL Benchmarks, faster then Fast – According to MySQL Benchmarks, faster then
most on Microsoft OSmost on Microsoft OS– Easy – Easy to download and installEasy – Easy to download and install– Platform independent – More then 20 different Platform independent – More then 20 different
platforms including Mac, Linux, Unix and Windowsplatforms including Mac, Linux, Unix and Windows– Accessible – Fully networked, accessed from Accessible – Fully networked, accessed from
anywhereanywhere– FreeFree
Both Access and MySQL?Both Access and MySQL?
Access –Access –
The Watson The Watson Adventure Game Adventure Game Disconnected modeDisconnected mode
MySQL –MySQL –
The Watson The Watson Adventure Game Adventure Game Connected modeConnected mode
FutureFuture
Implement Stored ProceduresImplement Stored Procedures– Move queries from server code to the Move queries from server code to the
databasedatabase– Benefits: Security, performance, and Benefits: Security, performance, and
business logic abstraction.business logic abstraction.
Implement TransactionsImplement Transactions– For data commitment to the databaseFor data commitment to the database– Benefits: If something goes wrong during a Benefits: If something goes wrong during a
transaction, data is not lost.transaction, data is not lost.
Table Creation ScriptsTable Creation Scripts
By Brian GeBy Brian Ge
The TaskThe Task
Migrate the tables from the Microsoft Migrate the tables from the Microsoft Access database to MySQL.Access database to MySQL.
Slight ProblemSlight Problem– Access provides no way to export the table Access provides no way to export the table
structure of the database.structure of the database.
The SolutionThe Solution
There were multiple solutions for There were multiple solutions for overcoming Access’ short fallings.overcoming Access’ short fallings.
These include:These include:– Commercially available services and software.Commercially available services and software.– In-house developed software.In-house developed software.– Hybrid solutions.Hybrid solutions.
Commercial SolutionsCommercial Solutions
You can purchase commercial software that will convert your You can purchase commercial software that will convert your database to another type of database, or you can hire people to do database to another type of database, or you can hire people to do it for you.it for you.
ProsPros– Potentially time saving.Potentially time saving.– Easy, hands off solution.Easy, hands off solution.– Accurate (if using consultants) representation of your existing Accurate (if using consultants) representation of your existing
database.database.
ConsCons– Expensive!Expensive!– Information ControlInformation Control
In-house SoftwareIn-house Software
We could have also built our own software package that would We could have also built our own software package that would comb through the existing database using available APIs and then comb through the existing database using available APIs and then formatting the data so that it could be imported into another formatting the data so that it could be imported into another database. (In essence do what the commercial programs do.)database. (In essence do what the commercial programs do.)
ProsPros– No additional monetary cost.No additional monetary cost.– Customized solution.Customized solution.
ConsCons– Very difficult API to work with.Very difficult API to work with.– Extremely time consuming to get it right.Extremely time consuming to get it right.
Hybrid SolutionsHybrid Solutions
We eventually decided on a “hybrid We eventually decided on a “hybrid solution” to our table migration problem.solution” to our table migration problem.
The size of the WAG database was of The size of the WAG database was of sufficiently small size that we could look at sufficiently small size that we could look at all the Access tables, and write a SQL all the Access tables, and write a SQL script that would re-create the tables.script that would re-create the tables.
Hybrid SolutionsHybrid Solutions
After determining the basic structure of the Access database, we After determining the basic structure of the Access database, we were able to create a script that can be directly imported into were able to create a script that can be directly imported into MySQL.MySQL.
Other TasksOther Tasks
My other duties included supporting the My other duties included supporting the existing Access database.existing Access database.
In that regard, I have also been working In that regard, I have also been working closely with other team members to keep closely with other team members to keep the Access database up to date with our the Access database up to date with our new MySQL database.new MySQL database.
Scripts to move existing data to Scripts to move existing data to MySQL MySQL
& & Support Existing Access DB Support Existing Access DB
By Paul Juckiewicz By Paul Juckiewicz
TasksTasks
Write scripts in Java to automate the move Write scripts in Java to automate the move of existing data from Access to MySQLof existing data from Access to MySQL
Support existing Access Database Support existing Access Database
Script MechanicsScript Mechanics
Scripts will be written in Java using the Scripts will be written in Java using the JDBC API (Java Database Connectivity) JDBC API (Java Database Connectivity) and MySQL Connector/Jand MySQL Connector/J
JDBC, MySQL Connector/JJDBC, MySQL Connector/J
JDBC API allows the access to any JDBC API allows the access to any relational database from Java whether relational database from Java whether you’re on Linux, Solaris or Windowsyou’re on Linux, Solaris or Windows
MySQL Connector/J is the official JDBC MySQL Connector/J is the official JDBC driver for MySQL (allows Java to connect driver for MySQL (allows Java to connect to MySQL)to MySQL)
Script MethodScript Method
Script will initially dump the tables in Script will initially dump the tables in MySQLMySQL
Script will than move existing data from Script will than move existing data from the Access Database to existing tables on the Access Database to existing tables on the MySQL Serverthe MySQL Server
Existing Data in Access will not be Existing Data in Access will not be changed in anyway through this scriptchanged in anyway through this script
Support Existing DatabaseSupport Existing Database
Manage database contentManage database content
Make sure database is synchronized with Make sure database is synchronized with the MySQL database at all times.the MySQL database at all times.
Make sure there are no inequalities Make sure there are no inequalities between Access and MySQL throughout between Access and MySQL throughout the development of the database structurethe development of the database structure
Possible Future ReleasesPossible Future Releases
Create GUI for the script to move data Create GUI for the script to move data from Access to MySQLfrom Access to MySQL
Create more specific functionality for the Create more specific functionality for the movement of existing data from Access to movement of existing data from Access to MySQLMySQL
Expanding Challenge Data to Expanding Challenge Data to Include EE and MEInclude EE and ME
By Laurel AndersenBy Laurel Andersen
OverviewOverview
Each challenge consists of 5 questions Each challenge consists of 5 questions with 4 choices for each questionwith 4 choices for each question
These questions are tailored to describe These questions are tailored to describe the core courses for Electrical Engineering the core courses for Electrical Engineering (EE) and Mechanical Engineering (ME)(EE) and Mechanical Engineering (ME)
Core Courses For EECore Courses For EEDiscovering Engineering IDiscovering Engineering ITechnical Communications I Technical Communications I Discovering Engineering II Discovering Engineering II Technical Communications II Technical Communications II Digital Logic Design Digital Logic Design Electrical and Computer Engineering Seminar I Electrical and Computer Engineering Seminar I Probabilistic Systems IProbabilistic Systems IElectrical CircuitsElectrical CircuitsMicroprocessors Microprocessors Electronics I Electronics I Signals and Systems Signals and Systems Electrical and Computer Engineering Seminar IIElectrical and Computer Engineering Seminar IIEE Design LabEE Design LabElectromagnetics Electromagnetics Control Systems Control Systems Communication Systems Communication Systems Senior Project I Senior Project I Senior Project I ISenior Project I I
Core Courses For MECore Courses For MEDiscovering Engineering IDiscovering Engineering ITechnical Communications I Technical Communications I Discovering Engineering II Discovering Engineering II Technical Communications IITechnical Communications IIEngineering MechanicsEngineering MechanicsMechanics of Deformable Bodies Mechanics of Deformable Bodies Electrical CircuitsElectrical CircuitsEngineering ComputingEngineering ComputingComputer-Aided Engineering Computer-Aided Engineering Thermodynamics Thermodynamics Science of Engineering MaterialsScience of Engineering MaterialsEngineering AnalysisEngineering AnalysisMachine Design Machine Design Fluid Mechanics Fluid Mechanics Project Management Project Management Engineering Computational Engineering Computational Methods Methods
VibrationsVibrationsHeat Transfer Heat Transfer Control Systems in Mechanical Control Systems in Mechanical Engineering Engineering Senior LabSenior LabSenior Project I Senior Project I Senior Project IISenior Project II
Table DesignTable Design
ChallengeID: Primary KeyChallengeID: Primary Key
ChallengeQuestion: stores the questionChallengeQuestion: stores the question
ChallengeAnswer(1-4): stores 3 incorrect ChallengeAnswer(1-4): stores 3 incorrect answers and one right oneanswers and one right one
RightAnswer: designates the right answerRightAnswer: designates the right answer
FacultyID: designates the faculty member FacultyID: designates the faculty member that will present the testthat will present the test
HotSpotID: gives the hot spot IDHotSpotID: gives the hot spot ID
Ideas For The FutureIdeas For The Future
Expanding challenges to include life challengesExpanding challenges to include life challengesEx:Ex:
Your laptop has crashed while you were writing your term paper. Your laptop has crashed while you were writing your term paper. You can either:You can either:
A: Try to fix it yourself.A: Try to fix it yourself.B: Ask Computer Services for help.B: Ask Computer Services for help.C: Cry yourself to sleep.C: Cry yourself to sleep.
Choice A will give you 50 experience points.Choice A will give you 50 experience points.You successfully retrieved your paper.You successfully retrieved your paper.
Choice B and C will take away 50 experience points. Choice B and C will take away 50 experience points. You should know better than to ask Computer Services for help.You should know better than to ask Computer Services for help.Crying never gets you anywhere. Crying never gets you anywhere.
Expanding and Modify Expanding and Modify Database Tables to Database Tables to
Accommodate New EE & ME Accommodate New EE & ME Faculty DataFaculty Data
By Di ZhangBy Di Zhang
TaskTask
To expand the current existing database of To expand the current existing database of Watson faculty.Watson faculty.
– Current faculty– Computer ScienceCurrent faculty– Computer Science– ExpandExpand
Electrical Engineering(EE)Electrical Engineering(EE)
Mechanical Engineering(ME) Mechanical Engineering(ME)
New Faculty DataNew Faculty Data
The data required for the EE & ME The data required for the EE & ME professors is the same as those from CS.professors is the same as those from CS.– PicturesPictures– NamesNames– Phone NumbersPhone Numbers– EmailsEmails– Course IDsCourse IDs
TablesTablesUpdatesUpdates– Course TableCourse Table
CourseIDCourseID
– Faculty TableFaculty TableMajorIDMajorID
– Hotspot TableHotspot TableMajorIDMajorID
– Character TableCharacter TableMajorIDMajorID
CourseIDCourseIDCS Courses are labeled 1 - 42CS Courses are labeled 1 - 42EE & ME courses will be labeled from 43 onEE & ME courses will be labeled from 43 on
New FieldNew Field
New FieldNew Field– MajorID (Required – Number)MajorID (Required – Number)
CS = 0CS = 0
EE = 1EE = 1
ME = 2ME = 2
Helps to distinguish students and faculty Helps to distinguish students and faculty from the three departments when from the three departments when performing data searchesperforming data searches
Look AheadLook Ahead
New field instead of new table, more New field instead of new table, more suitable for future department expansionsuitable for future department expansion– More OrganizedMore Organized– Less work for those who will be working on Less work for those who will be working on
this game next semester and onthis game next semester and on
TablesTables
MySQL Maintenance ToolMySQL Maintenance Tool
By Logan EverettBy Logan Everett
PurposePurpose
Remote access to MySQL DatabasesRemote access to MySQL Databases– Dump all data in tableDump all data in table– Allow user editAllow user edit– Upload back to tableUpload back to table
Assume server is shut downAssume server is shut down
ImplementationImplementation
Use Java/JDBCUse Java/JDBC
Needs restrictions to preserve relational Needs restrictions to preserve relational integrityintegrity
Critical FeaturesCritical Features
JTable-based GUI and Data ModelJTable-based GUI and Data Model
General DB Info and List of TablesGeneral DB Info and List of Tables
Foreign Key PreservationForeign Key Preservation
Add, Delete, Edit RowsAdd, Delete, Edit Rows
Local Backup/Restore SystemLocal Backup/Restore System