-
Notifications
You must be signed in to change notification settings - Fork 5
/
SQL_Config.cfg
61 lines (50 loc) · 3.07 KB
/
SQL_Config.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Configuration file for SQL interface capability within DSI Toolbox
#
# Note that all field data should be enclosed in MATLAB-compatible single quotes (')
# Pound signs (#) denote comments, but only at the beginning of the line
# Assignments are dictated by ':='
# Note that single quotes (') are reserved to determine the overall data fields. Use double quotes (") for strings
#
# Also note the interfacing method utilized by the SQL connection may only work within Microsoft Windows environments
#
# Examples provided are using the MariaDB 1.1.6 Java client
#
# For password prompts, it is highly recommended that Jesse Lai's passwordEntryDialog routine
# be downloaded from the MathWork's File Exchange. This uses Java routines to help mask typed passwords.
# (http://www.mathworks.com/matlabcentral/fileexchange/19729-passwordentrydialog)
# Interfacing JAR file name - example below is for MariaDB
# Include the full path to this if it is not in the MATLAB working path
JARFile:='C:\Downloads\mariadb-java-client-1.1.6.jar'
# Driver name for the SQL interface
JARDriverName:='org.mariadb.jdbc.Driver'
# Connection string for the database
# Note that curly brace bracketed items (e.g., {port}) will look for the appropriate "JARxx" field in this file.
# e.g., {HOST} will look for JARHOST inside this .CFG file for the information - case is important here!
JARConnectString:='jdbc:mariadb://{host}:{port}/{database}'
# Hostname
JARhost:='127.0.0.1'
# Port
JARport:='3306'
# Database/schema
JARdatabase:='mysql'
# Quantities below here are set as properties to the specific SQL connection
# Anything specified as JARPROPxxx will be filled into a property field for the connection.
# i.e., JARPROPuser:='test' will put 'test' as the value for the 'user' property.
# Username for the SQL database connection
JARPROPuser:='root'
# Password - leave this '' to have MATLAB prompt you at connect
# If you store a password here, it is highly recommended you encrypt this file
JARPROPpassword:=''
# Define SQL Query as a single line -- substitute curly braces for fields to prompt during MATLAB runtime
# e.g., SELECT {range} FROM {databasename} would prompt the user for the value of "range" and "databasename" and
# substitute those values into the query.
# It is highly recommended that a specific VIEW be created on the SQL server for the specific types of information requested
# Note that the first column returned is always expected to be time, preferably in yyyy-mm-dd HH:MM:SS.FFF-type format
# JARSQLQuery:='SELECT {range} FROM {view}'
JARSQLQuery:='SELECT * FROM TEST_VALS'
# Below are some sample queries - note that the "tag" field is often how SQL interfaces with PI
# Historians can determine channel names
# JARSQLQuery:='SELECT * FROM TEST_VALS_VIEW {where}'
# JARSQLQuery:='SELECT * FROM TEST_VALS_VIEW WHERE Time >= "2014-02-28 13:41:30" AND Time <= "2014-02-28 13:42:05"'
# JARSQLQuery:='SELECT * FROM datatable WHERE Time >= "2014-02-28 13:41:30" AND Time <= "2014-02-28 13:42:05" and tag="other"'
# JARSQLQuery:='SELECT * FROM datatable WHERE tag="freq"'