目录
Neo4j ETL
Overview
Features
License
Issues & Feedback & Contributions
Download & Run
Examples of command usage:
Neo4j-Desktop
JDBC Drivers
Introduction
Architecture Diagram
What it is
Plans for the Future
Who is it for
Open Questions
neo4j-etl Command Line Tool
Available commands
'generate-metadata-mapping' command
'export' command
Parameters Usage
Example Session: Basic
Generate Metadata Mapping
Offline Bulk Import via neo4j-import tool for initial load (Neo4j database must be empty)
Online Batch Import via java-bolt-driver for incremental load (neo4j can be already populated)
Example Session: Docker + Northwind
MySQL
PostgreSQL
Oracle
Microsoft SQL
How to import World Wide Importers database into a MS SQL server Docker instance
Capabilities
Inferring Schema with Mapping Rules (generate-metadata-mapping)
Edit Mapping via UI
Exporting Data (export)
Neo4j ETL
Overview
Features
Neo4j-ETL UI in Neo4j Desktop
Manage multiple RDBMS connections
automatically extract database metadata from relational database
derive graph model
visually edit labels, relationship-types, property-names and types
visualize current model as a graph
persist mapping as json
retrieve relevant CSV data from relational databases
run import via neo4j-import, bolt-connector, cypher-shell, neo4j-shell
bundles MySQL, PostgreSQL, allows custom JDBC driver with Neo4j Enterprise
License
This tool is licensed under the NEO4J PRE-RELEASE LICENSE AGREEMENT.
Issues & Feedback & Contributions
Download & Run
Download & unzip the latest neo4j-etl.zip.
Examples of command usage:
Minimal command line
./bin/neo4j-etl export \
--rdbms:url --rdbms:user --rdbms:password \
--destination $NEO4J_HOME/data/databases/graph.db/ --import-tool $NEO4J_HOME/bin \
--csv-directory $NEO4J_HOME/import
Full set of command line options
./bin/neo4j-etl export \
--rdbms:url --rdbms:user --rdbms:password --rdbms:schema \
--using { bulk:neo4j-import | cypher:neo4j-shell | cypher:shell | cypher:direct } \
--neo4j:url --neo4j:user --neo4j:password \
--destination $NEO4J_HOME/data/databases/graph.db/ --import-tool $NEO4J_HOME/bin \
--csv-directory $NEO4J_HOME/import --options-file import-tool-options.json --force --debug
For detailed usage see also the: tool documentation.
Neo4j-Desktop
You can add Neo4j ETL to Neo4j Desktop by adding the appropriate application key. Please ask your Neo4j contact or send an email to [email protected]
Then the next time you start Neo4j Desktop you’ll see Neo4j ETL as a UI to be used interactively.
Configure Driver
Load Mapping
Edit Mapping
Import Data
JDBC Drivers
The drivers for MySQL and PostgreSQL are bundled with the Neo4j-ETL tool.
To use other JDBC drivers use these download links and JDBC URLs. Provide the JDBC driver jar-file to the command line tool or Neo4j-ETL application. And use the JDBC-URL with the --rdbms:url
parameter or in the JDBC-URL input field.
Database
JDBC-URL
Driver Source
Oracle
jdbc:oracle:thin:/@:/
Oracle JDBC Driver
MS SQLServer
jdbc:sqlserver://;servername=;databaseName=;user=;password=
SQLServer Driver
IBM DB2
jdbc:db2://:/:user=;password=;
DB2 Driver
Derby
jdbc:derby:derbyDB
Included since JDK6
Cassandra
jdbc:cassandra://:/
Cassandra JDBC Wrapper
SAP Hana
jdbc:sap://:/?user=&password=
SAP Hana ngdbc Driver
MySQL
jdbc:mysql://:/?user=&password=
MySQL Driver
PostgreSQL
jdbc:postgresql:///?user=&password=
PostgreSQL JDBC Driver
Introduction
The Neo4j ETL, especially the neo4j-etl
command-line tool, can be used to import well modeled (i.e. normalized) relational data into Neo4j. It applies some simple rules for transforming the relational model.
The process as outlined below:
Read database metadata and generate mapping.json
Optionally edit mapping.json with the neo4j-etl-ui
in Neo4j Desktop
Export relational data to CSV
Generate Mapping Headers
Import into Neo4j using
the neo4j-import
tool for initial offline bulk load
the neo4j-shell
tool for incremental offline bulk load
the cypher-shell
tool for incremental online single-transaction load
the java bolt driver
for incremental online batch load
Architecture Diagram
What it is
Command-Line tools
Java API/library
Infer Schema and save in mapping file
Filter and merge strategies
Read mapping file to export data from other databases then
Import into Neo via different tools (neo4j-import
, neo4j-shell
, cypher-shell
, java bolt driver
)
Work in offline and online mode
Import in both an empty (initial load) and not-empty graph (incremental)
Build indexes and constraints
Support on Unix-like and Microsoft Operating Systems
Support for most popular relational databases like MySQL, PostgreSQL, Oracle and Microsoft SQL
Support user specified JDBC drivers
UI tool to visually modify mappings
Plans for the Future
Custom Mapping Rules + Transformations for names, data, links
Exemplary integration into a 3rd party ETL pipeline
More data types (binary, datetime, geo)
Who is it for
Developer learning to work with Neo4j for initial data import
Partners providing data integration with Neo4j
Enterprise developers building applications based on well modeled relational data
Open Questions
Date and binary datatypes
Security (secure connections, handling of passwords, encrypting data)
neo4j-etl Command Line Tool
This is the command-line tool you use to retrieve and map the metadata from your relational database and drive the export from the relational and import into Neo4j database.
With the graphical user interface you can preview the resulting graph data model and eventually adapt it by changing labels, property names, relationship-types and property types.
It supports all relational databases with a JDBC driver, like MySQL , PostgreSQL , Oracle and Microsoft SQL .
You can get the latest version of the import tool from GitHub.
Once downloaded and uncompressed the operating system specific zip
/ tar.gz
, you also need download the proper JDBC Driver and add it to the lib
folder.
You can follow the proper link in the below table in order to download the proper driver jar
Vendor
JDBC Driver URL
MySql
http://dev.mysql.com/downloads/connector/j/
PostgreSql
https://jdbc.postgresql.org/download.html
Oracle
http://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html
Microsoft SQL Server
https://www.microsoft.com/en-us/download/details.aspx?id=55539
NOTE
For very large databases make sure to have enough disk-space for the CSV export and the Neo4j datastore and enough RAM and CPUs to finish the import quickly.
Available commands
NAME
neo4j-etl generate-metadata-mapping - Create RDBMS to Neo4j metadata
mapping Json.
SYNOPSIS
neo4j-etl generate-metadata-mapping
[ {--columns | --cols} ... ]
[ --config-file ]
[ {-d | --database} ] [ --debug ]
[ --delimiter ] [ {--driver | --jars} <--driver --driver >... ]
[ {--exclusion-mode | --exc} ]
[ {--exclusion-mode-column-type | --exctype} ]
[ {--exclusion-mode-columns | --excc} ]
[ {--exclusion-mode-tables | --exct} ]
[ --options-file ] [ --output-mapping-file ]
[ {-p | --port} ] [ --quote ]
[ {--rdbms:fetch-size | --fs} ]
[ {--rdbms:password | --password} ]
[ {--rdbms:schema | -s | --schema} ]
[ {--rdbms:url | --url} ]
[ {--rdbms:user | -u | --user} ]
[ {--relationship-name | --rel-name} ]
[ --schemas ... ] [ {--tables | --tabs} ... ]
[ --tiny-int ] [ --types ... ] [--] [ ... ]
OPTIONS
--columns , --cols
Lists all columns to include/exclude by name or pattern
Use '-r' to filter by regex, ex. '-r .*\.orders\..*_id' or
'northwind\.orders\..*_id' ,
'-g' for grep syntax, ex. '-g .*\.orders\..*_id' or
'northwind\.orders\..*_id' ,
or '-l' to list all columns names ex. '-l
northwind.customers.id,northwind.purchase.id,northwind.orders.id'
--config-file
Specify the path to a file containing the configuration for the
selected command
-d , --database
RDBMS database.
This option is required if any of the following options are
specified: host
--debug
Print detailed diagnostic output.
--delimiter
Delimiter to separate fields in CSV.
--driver <--driver --driver >, --jars <--driver --driver >
List of additional drivers as a list
--exclusion-mode , --exc
Specifies how to handle table exclusion. Options are mutually
exclusive.
exclude: Excludes specified tables from the process. All other
tables will be included.
include: Includes specified tables only. All other tables will be
excluded.
none: All tables are included in the process.
--exclusion-mode-column-type , --exctype
Specifies how to handle column type exclusion. Options are mutually
exclusive.
exclude: Excludes specified columns types from the process. All
other columns types will be included.
include: Includes specified columns types only. All other columns
types will be excluded.
none: All columns types are included in the process.
--exclusion-mode-columns , --excc
Specifies how to handle column exclusion. Options are mutually
exclusive.
exclude: Excludes specified columns from the process. All other
columns will be included.
include: Includes specified columns only. All other columns will be
excluded.
none: All columns are included in the process.
--exclusion-mode-tables , --exct
Specifies how to handle table exclusion. Options are mutually
exclusive.
exclude: Excludes specified tables from the process. All other
tables will be included.
include: Includes specified tables only. All other tables will be
excluded.
none: All tables are included in the process.
--options-file
Path to file containing Neo4j import tool options.
--output-mapping-file
Path to the output metadata mapping file.
-p , --port
Port number to use for connection to RDBMS.
--quote
Character to treat as quotation character for values in CSV data.
--rdbms:fetch-size , --fs
RDBMS Fetch size
--rdbms:password , --password
Password for login to RDBMS.
This option is required if any of the following options are
specified: --rdbms:url, --url
--rdbms:schema , -s , --schema
RDBMS schema.
--rdbms:url , --url
Url to use for connection to RDBMS.
--rdbms:user , -u , --user
User for login to RDBMS.
This option is required if any of the following options are
specified: --rdbms:url, --url
--relationship-name , --rel-name
Specifies whether to get the name for relationships from table names
or column names.
--schemas
Lists all schemas to include by name or pattern.
Use '-r' to filter by regex, ex. '-r .*\.north.*',
'-g' for grep syntax, ex. '-g .*\.north.*' ,
or '-l' to list all schemas names ex. '-l northwind,exc'
--tables , --tabs
Lists all tables to include/exclude by name or pattern.
Use '-r' to filter by regex, ex. '-r .*\.purchase.*' or
'northwind.purchase.*' ,
'-g' for grep syntax, ex. '-g .*\.purchase.*' or
'northwind.purchase.*' ,
or '-l' to list all tables names ex. '-l
customers,purchase,orders'
--tiny-int
Specifies whether to convert TinyInt to byte or boolean
--types
Lists all column types to include/exclude by name separated by
commas. Valid values:
unknown,
binary,
bit,
character,
id,
integer,
real,
reference,
temporal,
url,
xml,
large_object,
object;
--
This option can be used to separate command-line options from the
list of arguments (useful when arguments might be mistaken for
command-line options)
Tables to be excluded/included
'export' command
NAME
neo4j-etl export - Export from RDBMS and import into NEO4J via CSV
files.
SYNOPSIS
neo4j-etl export [ {--columns | --cols} ... ]
[ --config-file ]
[ --csv-directory ]
[ {-d | --database} ] [ --debug ]
[ --delimiter ] [ --destination ] [ {--driver | --jars} <--driver --driver >... ]
[ {--exclusion-mode | --exc} ]
[ {--exclusion-mode-column-type | --exctype} ]
[ {--exclusion-mode-columns | --excc} ]
[ {--exclusion-mode-tables | --exct} ]
[ --force ] [ --import-tool ]
[ --mapping-file ] [ {--neo4j:password | --graph:password | --graph:neo4j:password} ]
[ {--neo4j:url | --graph:url | --graph:neo4j:url} ]
[ {--neo4j:user | --graph:user | --graph:neo4j:user} ]
[ --options-file ] [ --output-mapping-file ]
[ {-p | --port} ] [ --quote ]
[ {--rdbms:fetch-size | --fs} ]
[ {--rdbms:password | --password} ]
[ {--rdbms:schema | -s | --schema} ]
[ {--rdbms:url | --url} ]
[ {--rdbms:user | -u | --user} ]
[ {--relationship-name | --rel-name} ]
[ --schemas ... ] [ {--tables | --tabs} ... ]
[ --tiny-int ] [ --types ... ]
[ --using ] [--] [ ... ]
OPTIONS
--columns , --cols
Lists all columns to include/exclude by name or pattern
Use '-r' to filter by regex, ex. '-r .*\.orders\..*_id' or
'northwind\.orders\..*_id' ,
'-g' for grep syntax, ex. '-g .*\.orders\..*_id' or
'northwind\.orders\..*_id' ,
or '-l' to list all columns names ex. '-l
northwind.customers.id,northwind.purchase.id,northwind.orders.id'
--config-file
Specify the path to a file containing the configuration for the
selected command
--csv-directory
Path to directory for intermediate CSV files.
-d , --database
RDBMS database.
This option is required if any of the following options are
specified: host
--debug
Print detailed diagnostic output.
--delimiter
Delimiter to separate fields in CSV.
--destination
Path to destination store directory.
--driver <--driver --driver >, --jars <--driver --driver >
List of additional drivers as a list
--exclusion-mode , --exc
Specifies how to handle table exclusion. Options are mutually
exclusive.
exclude: Excludes specified tables from the process. All other
tables will be included.
include: Includes specified tables only. All other tables will be
excluded.
none: All tables are included in the process.
--exclusion-mode-column-type , --exctype
Specifies how to handle column type exclusion. Options are mutually
exclusive.
exclude: Excludes specified columns types from the process. All
other columns types will be included.
include: Includes specified columns types only. All other columns
types will be excluded.
none: All columns types are included in the process.
--exclusion-mode-columns , --excc
Specifies how to handle column exclusion. Options are mutually
exclusive.
exclude: Excludes specified columns from the process. All other
columns will be included.
include: Includes specified columns only. All other columns will be
excluded.
none: All columns are included in the process.
--exclusion-mode-tables , --exct
Specifies how to handle table exclusion. Options are mutually
exclusive.
exclude: Excludes specified tables from the process. All other
tables will be included.
include: Includes specified tables only. All other tables will be
excluded.
none: All tables are included in the process.
--force
Force delete destination store directory if it already exists.
--import-tool
Path to directory containing Neo4j import tool.
--mapping-file
Path to an existing metadata mapping file. The name 'stdin' will
cause the CSV resources definitions to be read from standard input.
--neo4j:password , --graph:password ,
--graph:neo4j:password
Password for login to Neo4j.
--neo4j:url , --graph:url , --graph:neo4j:url
Url to use for connection to Neo4j.
--neo4j:user , --graph:user , --graph:neo4j:user
User for login to Neo4j.
--options-file
Path to file containing Neo4j import tool options.
--output-mapping-file
Path to the output metadata mapping file.
-p , --port
Port number to use for connection to RDBMS.
--quote
Character to treat as quotation character for values in CSV data.
--rdbms:fetch-size , --fs
RDBMS Fetch size
--rdbms:password , --password
Password for login to RDBMS.
This option is required if any of the following options are
specified: --rdbms:url, --url
--rdbms:schema , -s , --schema
RDBMS schema.
--rdbms:url , --url
Url to use for connection to RDBMS.
--rdbms:user , -u , --user
User for login to RDBMS.
This option is required if any of the following options are
specified: --rdbms:url, --url
--relationship-name , --rel-name
Specifies whether to get the name for relationships from table names
or column names.
--schemas
Lists all schemas to include by name or pattern.
Use '-r' to filter by regex, ex. '-r .*\.north.*',
'-g' for grep syntax, ex. '-g .*\.north.*' ,
or '-l' to list all schemas names ex. '-l northwind,exc'
--tables , --tabs
Lists all tables to include/exclude by name or pattern.
Use '-r' to filter by regex, ex. '-r .*\.purchase.*' or
'northwind.purchase.*' ,
'-g' for grep syntax, ex. '-g .*\.purchase.*' or
'northwind.purchase.*' ,
or '-l' to list all tables names ex. '-l
customers,purchase,orders'
--tiny-int
Specifies whether to convert TinyInt to byte or boolean
--types
Lists all column types to include/exclude by name separated by
commas. Valid values:
unknown,
binary,
bit,
character,
id,
integer,
real,
reference,
temporal,
url,
xml,
large_object,
object;
--using
Import tool that will be used to load data into neo4j.
--
This option can be used to separate command-line options from the
list of arguments (useful when arguments might be mistaken for
command-line options)
Tables to be excluded/included
Parameters Usage
There are two ways for write Etl parameters:
1) write parameters in command line:
$NEO4J_HOME/bin/neo4j-etl export|generate-metadata-mapping
--rdbms:url jdbc:oracle:thin:@localhost:49161:XE
--rdbms:user northwind --rdbms :password northwind
--rdbms:schema northwind
--using bulk:neo4j-import
--import-tool $NEO4J_HOME/bin
--csv-directory /tmp/northwind
--options-file /tmp/northwind/options.json
--quote '"' --force
...
2) use a config file:
$NEO4J_HOME/bin/neo4j-etl export|generate-metadata-mapping \
--config-file
Above there is an Example of config file.
#EXAMPLE - ETL CONFIG FILE
#RDBMS
rdbms-url=url
rdbms-schema=schema
rdbms-password=neo4j
rdbms-user=neo4j
rdbms-fetch-size=10000
#NEO4J
using=cypher:direct
neo4j-url=bolt://127.0.0.1:7687
neo4j-user=neo4j
neo4j-password=neo4j
#RULES
exclusion-mode-tables=INCLUDE
tables=-l table1,table2,...
exclusion-mode-columns=INCLUDE
columns=-l column1,column2,...
exclusion-mode-column-types=EXCLUDE
column-types=type1,type2,...
#MISC
output-mapping-file=path_to_output_mapping_file
import-tool=path_to_import_tool
csv-directory=path_to_directory
mapping-file=path_to_file
debug=false
Example Session: Basic
export NEO4J_HOME=/path/to/neo4j-enterprise-3.4.0
mkdir -p /tmp/northwind
$NEO4J_HOME/bin/neo4j-etl generate-metadata-mapping \
--rdbms:url jdbc:oracle:thin:@localhost:49161:XE \
--rdbms:user northwind --rdbms:password northwind \
--rdbms:schema northwind --output-mapping-file /tmp/northwind/mapping.json
echo '{ "multiline-fields" : "true" }' > /tmp/northwind/options.json
$NEO4J_HOME/bin/neo4j-etl export \
--rdbms:url jdbc:oracle:thin:@localhost:49161:XE \
--rdbms:user northwind --rdbms :password northwind \
--rdbms:schema northwind \
--using bulk:neo4j-import \
--import-tool $NEO4J_HOME/bin \
--csv-directory /tmp/northwind \
--options-file /tmp/northwind/options.json \
--quote '"' --force
Test Offline Bulk Import result
$NEO4J_HOME/bin/neo4j-shell -path $NEO4J_HOME/data/databases/graph.db/ -c 'MATCH (n) RETURN labels(n), count(*);'
+--------------------------+
| labels(n) | count(*) |
+--------------------------+
| ["Shipper"] | 3 |
| ["Employee"] | 9 |
| ["Region"] | 4 |
| ["Customer"] | 93 |
| ["Territory"] | 53 |
| ["Product"] | 77 |
| ["Supplier"] | 29 |
| ["Order"] | 830 |
| ["Category"] | 8 |
+--------------------------+
9 rows
Online Batch Import via java-bolt-driver
for incremental load (neo4j can be already populated)
echo '{ "multiline-fields" : "true" }' > /tmp/northwind/options.json
$NEO4J_HOME/bin/neo4j-etl export \
--rdbms:url jdbc:oracle:thin:@localhost:49161:XE \
--rdbms:user northwind --rdbms:password northwind \
--rdbms:schema northwind \
--using cypher:direct \
--neo4j:url bolt://localhost:7687 \
--neo4j:user neo4j --neo4j:password neo4j \
--import-tool $NEO4J_HOME/bin \
--csv-directory /tmp/northwind \
--options-file /tmp/northwind/options.json \
--quote '"' --force
Test Online Batch Incremental Import result
$NEO4J_HOME/bin/cypher-shell -a bolt://localhost:7687 -u neo4j -p neo4j 'MATCH (n) RETURN labels(n), count(*);'
+--------------------------+
| labels(n) | count(*) |
+--------------------------+
| ["Shipper"] | 3 |
| ["Employee"] | 9 |
| ["Region"] | 4 |
| ["Customer"] | 93 |
| ["Territory"] | 53 |
| ["Product"] | 77 |
| ["Supplier"] | 29 |
| ["Order"] | 830 |
| ["Category"] | 8 |
+--------------------------+
9 rows
Example Session: Docker + Northwind
This example session is based on the Northwind example dataset.
DDL scripts are available here:
MySQL
PostgreSQL
Oracle
Microsoft SQL
MySQL
Download, start and configure the docker container with MySQL:
docker pull mysql
docker run --name neo4j-etl-mysql -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE=northwind -e MYSQL_USER=neo4j -e MYSQL_PASSWORD=neo4j -d -p 3306:3306 mysql:latest
docker exec -it neo4j-etl-mysql bash
root@eb6f279fdb88:/# mysql -u root -p
Enter password: admin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> grant all privileges on *.* to 'neo4j'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
Bye
root@bf99fbc0d31c:/# exit
exit
Load the database via the following sql script: https://raw.githubusercontent.com/neo4j-contrib/neo4j-etl/master/neo4j-etl-it/src/main/resources/scripts/mysql/northwind.sql
export NEO4J_HOME=/path/to/neo4j-enterprise-3.4.0
mkdir -p /tmp/northwind
echo '{ "multiline-fields" : "true" }' > /tmp/northwind/options.json
./bin/neo4j-etl export \
--rdbms:url jdbc:mysql://localhost:5433/northwind?autoReconnect=true&useSSL=false \
--rdbms:user neo4j --rdbms:password neo4j \
--import-tool $NEO4J_HOME/bin \
--options-file /tmp/northwind/options.json \
--csv-directory /tmp/northwind \
--destination $NEO4J_HOME/data/databases/graph.db/ \
--quote '"' --force
PostgreSQL
Download, start and configure the docker container with PostgreSQL 9.6.2:
docker pull postgres
docker run --name neo4j-etl-postgres -e POSTGRES_USER=neo4j -e POSTGRES_PASSWORD=neo4j -d -p 5433:5432 postgres
docker run -it --rm --link neo4j-etl-postgres:postgres postgres psql -h postgres -U neo4j
Password for user neo4j:
psql (9.6.2)
Type "help" for help.
neo4j=# DROP DATABASE IF EXISTS northwind;
neo4j=# CREATE DATABASE northwind WITH OWNER 'neo4j' ENCODING 'UTF8' LC_COLLATE = 'en_US.utf8' LC_CTYPE = 'en_US.utf8';
neo4j=# \q
Load the database via the following sql script: northwind.sql
export NEO4J_HOME=/path/to/neo4j-enterprise-3.4.0
mkdir -p /tmp/northwind
echo '{"multiline-fields":"true"}' > /tmp/northwind/options.json
./bin/neo4j-etl export \
--rdbms:url jdbc:postgresql://localhost:5433/northwind?ssl=false \
--rdbms:user neo4j --rdbms:password neo4j \
--import-tool $NEO4J_HOME/bin \
--options-file /tmp/northwind/options.json \
--csv-directory /tmp/northwind \
--destination $NEO4J_HOME/data/databases/graph.db/ \
--quote '"' --force
Oracle
Download, start and configure the docker container with Oracle XE 11g:
docker pull wnameless/oracle-xe-11g
docker run --name neo4j-etl-oracle -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g
ssh root@localhost -p 49160
root@localhost's password: admin
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.9.13-moby x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Last login: Mon May 1 17:32:48 2017 from 172.17.0.1
root@692c446a274b:~# wget https://raw.githubusercontent.com/neo4j-contrib/neo4j-etl/master/neo4j-etl-it/src/main/resources/scripts/oracle/northwind.sql
root@692c446a274b:~# sqlplus system/oracle
SQL> CREATE USER northwind IDENTIFIED BY northwind;
SQL> GRANT DBA TO northwind;
SQL> CONN northwind/northwind;
SQL> SET sqlblanklines ON;
SQL> @northwind.sql
SQL> quit;
root@692c446a274b:~# exit
export NEO4J_HOME=/path/to/neo4j-enterprise-3.4.0
mkdir -p /tmp/northwind
echo '{"multiline-fields":"true"}' > /tmp/northwind/options.json
./bin/neo4j-etl export \
--rdbms:url jdbc:oracle:thin:@localhost:49161:XE \
--rdbms:user northwind --rdbms:password northwind \
--rdbms:schema northwind \
--import-tool $NEO4J_HOME/bin \
--options-file /tmp/northwind/options.json \
--csv-directory /tmp/northwind \
--destination $NEO4J_HOME/data/databases/graph.db/ \
--quote '"' --force
--driver /tmp/ojdbc6-11.2.0.3.jar
Microsoft SQL
Download, start and configure the docker container with Microsoft SQL Server:
docker run --name neo4j-etl-mssql -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Passw0rd!' -p 1433:1433 -d microsoft/mssql-server-linux
If you want to connect to Microsoft SQL client console then you can run the following command:
docker exec -it neo4j-etl-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Passw0rd!' -d
export NEO4J_HOME=/path/to/neo4j-enterprise-3.4.0
mkdir -p /tmp/wideworldimporters
echo '{"multiline-fields":"true"}' > /tmp/wideworldimporters/options.json
./bin/neo4j-etl export \
--rdbms:password "Passw0rd!" \
--rdbms:user sa \
--rdbms:url "jdbc:sqlserver://localhost:1433;databaseName=WideWorldImporters" \
--import-tool $NEO4J_HOME/bin \
--options-file /tmp/wideworldimporters/options.json \
--csv-directory /tmp/wideworldimporters \
--destination $NEO4J_HOME/data/databases/graph.db/ \
--driver /tmp/mssql-jdbc-6.1.0.jre8.jar \
How to import World Wide Importers database into a MS SQL server Docker instance
# Create docker instance for MS-SQL Server
docker run --name mssql-etl \
-e MSSQL_COLLATION=Latin1_General_100_CI_AS \
-e 'ACCEPT_EULA=Y' \
-e 'SA_PASSWORD=' \
-p 1433:1433 \
-v /tmp:/tmp \
-d microsoft/mssql-server-linux:2017-latest
# Download World Wide Importers backup file
wget https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/WideWorldImporters-Full.bak
# Create a backup directory
sudo docker exec -it mssql-etl mkdir /var/opt/mssql/backup
# Load backup file into the container
sudo docker cp WideWorldImporters-Full.bak mssql-etl:/var/opt/mssql/backup
# Restore Wide World Importers database
sudo docker exec -it mssql-etl /opt/mssql-tools/bin/sqlcmd \
-S localhost \
-U SA \
-P '' \
-Q 'RESTORE FILELISTONLY FROM DISK = "/var/opt/mssql/backup/WideWorldImporters-Full.bak"' \
| tr -s ' ' \
| cut -d ' ' -f 1-2
sudo docker exec -it mssql-etl /opt/mssql-tools/bin/sqlcmd \
-S localhost \
-U SA \
-P '' \
-Q 'RESTORE DATABASE WideWorldImporters FROM DISK = "/var/opt/mssql/backup/WideWorldImporters-Full.bak" WITH MOVE "WWI_Primary" TO "/var/opt/mssql/data/WideWorldImporters.mdf", MOVE "WWI_UserData" TO "/var/opt/mssql/data/WideWorldImporters_userdata.ndf", MOVE "WWI_Log" TO "/var/opt/mssql/data/WideWorldImporters.ldf", MOVE "WWI_InMemory_Data_1" TO "/var/opt/mssql/data/WideWorldImporters_InMemory_Data_1"'
Capabilities
Generic relational database mapping based on the following rules
A table with a foreign key is treated as a Join and imported as a node with a relationship
Ex: Person -> Address
is imported as (Person)-[:ADDRESS_ID]->(Address)
A table that has two foreign keys is imported as a JoinTable and imported as a relationship
Ex: Student <- Student_Course -> Course
is imported as(Student) -[:STUDENT_COURSE]-> (Course)
A table that has more than two foreign keys is treated as an intermediate node and imported as node with multiple relationships
Ex: Order_Detail -> Shipping_Address, Order_Detail -> Payment_Information, Order_Detail -> Shipment_Instructions
is imported as
(Shipping_Address) -[:SHIPPING]-> (Order_Detail)
(Payment_Information) -[:PAYMENT]-> (Order_Detail)
(Shipment_Instructions) -[:SHIPMENT]-> (Order_Detail)
Resolve relationships through composite keys.
Support most of the data types.
TinyInt can be imported as either Byte or as a Boolean (This is to support boolean values being saved in mysql as TinyInt)
Dates are imported as String
Blobs are skipped while importing until the import-tool supports binary array data.
Decimal to be confirmed.
Relationship names can either take column name or the table that is being referred to
Filter tables that you want to include or exclude using --include
and --exclude
TODO: Filter columns that you want to include or exclude using --include
and --exclude
TODO: Retaining natural keys(marked as PrimaryKeys and ForeignKeys) as needed using flag
A Foreign Key is usually used to create a relationship between 2 nodes without being saved as a property.
With this flag, the node would keep that value as a property.
Ex: A loan has the SSN of the loan applicant which would normally be used to connect the Loan
and Person
nodes.
With this flag the Loan
node will also keep the SSN
as a property.
Edit Mapping via UI
A Neo4j-ETL graph application can be added Neo4j Desktop which allows visual editing of the mapping and interactive import.
The UI allows you to change and set you preferred label names, property names and types, relationship types, with a preview of the resulting graph.
Exporting Data (export)
Last updated 2018-05-30 13:24:51 CEST
你可能感兴趣的:(数据库)
什么是缓存雪崩?缓存击穿?缓存穿透?分别如何解决?什么是缓存预热?
daixin8848
缓存 redis java 开发语言
缓存雪崩:在一个时间段内,有大量的key过期,或者Redis服务宕机,导致大量的请求到达数据库,带来巨大压力-给key设置不同的TTL、利用Redis集群提高服务的高可用性、添加多级缓存、添加降级流策略缓存击穿:给某一个key设置了过期时间,当key过期的时间,恰好这个时间点有大量的并发请求访问这个key,可能会瞬间把数据库压垮-互斥锁:缓存失败时,只允许一个请求去加载数据并更新缓存,其他请求阻塞
Aop +反射 实现方法版本动态切换
需求分析在做技术选型的时候一直存在着两个声音,mongo作为数据库比较mysql好,mysql做为该数据比mongo好。当然不同数据库都有有着自己的优势,我们在做技术选型的时候无非就是做到对数据库的扬长避短。mysql最大的优势就是支持事务,事务的五大特性保证的业务可靠性,随之而来的就是事务会产生的问题:脏读、幻读、不可重复度,当然我们也会使用不同的隔离级别来解决。(最典型的业务问题:银行存取钱)
MySQL复习题
一.填空题1.关系数据库的标准语言是SQL。2.数据库发展的3个阶段中,数据独立性最高的是阶段数据库系统。3.概念模型中的3种基本联系分别是一对一、一对多和多对多。4.MySQL配置文件的文件名是my.ini或my.cnf。5.在MySQL配置文件中,datadir用于指定数据库文件的保存目录。6.添加IFNOTEXISTS可在创建的数据库已存在时防止程序报错。7.MySQL提供的SHOWCREA
Android GreenDao介绍和Generator生成表对象代码
目录(?)[-]介绍创建工程转载请注明:http://blog.csdn.net/sinat_30276961/article/details/50052109最近无意中发现了GreenDao,然后查看了一些资料后,发现这个数据库框架很适合用,于是乎,查看了官网的api,并自己写了一个小应用总结一下它的使用方法。介绍按照国际惯例,在开篇,总要先介绍一下什么是GreenDao吧。首先需要说明的是Gr
Mac OSX 下的mysql数据库文件存放位置
Bruuuces
mysql mac osx 位置 存放
之前我的mysql的系统数据库里的表被我玩坏了,万般无奈之下只得删除所有mysql的东西重新构建数据库。按照网上搜到的内容删除后重装发现数据库没有什么变化。于是自己在每个可能存放数据库文件的目录查找,最终确认目录位置如下:使用HomeBrew安装为/usr/local/var/mysql使用官方下载的dmg镜像安装为/usr/local/mysql删除这个目录再重新安装mysql就会重新生成系统数
mac升级mysql_Mac OSX下的MySQL数据库升级
weixin_39801714
mac升级mysql
MacOSX下的数据库升级最麻烦的不过权限的问题.本文的MySQL的安装方式为OSX下DMG磁盘镜像的安装方式,MacPorts/Homebrew的方式大同小异.从5.6.17升级到5.7.18安装目录信息ls-al/usr/local|grepmysqllrwxr-xr-x1rootwheel30B52100:39mysql@->mysql-5.6.17-osx10.7-x86_64drwxr-
【MySQL】MySQL数据库如何改名
武昌库里写JAVA
面试题汇总与解析 spring boot vue.js sql java 学习
MySQL建库授权语句https://www.jianshu.com/p/2237a9649ceeMySQL数据库改名的三种方法https://www.cnblogs.com/gomysql/p/3584881.htmlMySQL安全修改数据库名几种方法https://blog.csdn.net/haiross/article/details/51282417MySQL重命名数据库https://
HikariCP调试日志深度解析:生产环境故障排查完全指南
HikariCP调试日志深度解析:生产环境故障排查完全指南更新时间:2025年7月4日|作者:资深架构师|适用版本:HikariCP5.x+|难度等级:中高级前言在生产环境中,数据库连接池往往是系统性能的关键瓶颈。HikariCP作为当前最流行的Java连接池,其调试日志包含了丰富的运行时信息,能够帮助我们快速定位和解决各种连接池相关问题。本文将深入解析HikariCP的日志体系,提供一套完整的故
大学社团管理系统(11831)
codercode2022
java spring boot spring echarts spring cloud sentinel java-rocketmq
有需要的同学,源代码和配套文档领取,加文章最下方的名片哦一、项目演示项目演示视频二、资料介绍完整源代码(前后端源代码+SQL脚本)配套文档(LW+PPT+开题报告)远程调试控屏包运行三、技术介绍Java语言SSM框架SpringBoot框架Vue框架JSP页面Mysql数据库IDEA/Eclipse开发四、项目截图有需要的同学,源代码和配套文档领取,加文章最下方的名片哦!
前端数据库:IndexedDB从基础到高级使用指南
文章目录前端数据库:IndexedDB从基础到高级使用指南引言一、IndexedDB概述1.1什么是IndexedDB1.2与其他存储方案的比较二、基础使用2.1打开/创建数据库2.2基本CRUD操作添加数据读取数据更新数据删除数据三、高级特性3.1复杂查询与游标3.2事务高级用法3.3性能优化技巧四、实战案例:构建离线优先的待办事项应用4.1数据库设计4.2同步策略实现五、常见问题与解决方案5.
修改gitlab默认的语言
Victor刘
gitlab
文章目录网上的方法1.采用数据库触发器的方法2.登录pg库2.1查看表2.2创建function2.3创建触发器2.4修改历史数据网上的方法网上修改/opt/gitlab/embedded/service/gitlab-rails/config/application.rb的方法,我试了,没生效,没进一步研究1.采用数据库触发器的方法2.登录pg库su-gitlab-psqlpsql-h/var/
如何在 Ubuntu 24.04 或 22.04 Linux 上安装和运行 Redis 服务器
山岚的运维笔记
Linux 运维及使用 linux 服务器 ubuntu redis 数据库
Redis(RemoteDictionaryServer,远程字典服务器)是一种内存数据结构存储,通常用作NoSQL数据库、缓存和消息代理。它是开源的,因此用户可以免费安装,无需支付任何费用。Redis旨在为需要快速数据访问和低延迟的应用程序提供速度和效率。Redis支持多种数据类型,包括字符串(Strings)、列表(Lists)、集合(Sets)、哈希(Hashes)、有序集合(SortedS
数据库基础概念梳理
22:30Plane-Moon
数据库
1.数据存储类型表(Table):存储结构化数据的标准方式,数据以行和列的形式组织,具有固定的格式。非结构化数据(UnstructuredData):如音频、视频、图片、文本文档等,其格式不固定,不易直接用表存储。2.SQL的核心优势SQL尤其擅长处理和操作存储在表中的结构化数据。2.1数据类型约束(DataTypeConstraints):定义列可存储的数据种类。整数类型:TINYINT(1字节
SQL笔记纯干货
AI入门修炼
oracle 数据库 sql
软件:DataGrip2023.2.3,phpstudy_pro,MySQL8.0.12目录1.DDL语句(数据定义语句)1.1数据库操作语言1.2数据表操作语言2.DML语句(数据操作语言)2.1增删改2.2题2.3备份表3.DQL语句(数据查询语言)3.1查询操作3.2题一3.3题二4.多表详解4.1一对多4.2多对多5.多表查询6.窗口函数7.拓展:upsert8.sql注入攻击演示9.拆表
分布式全局唯一ID生成:雪花算法 vs Redis Increment,怎么选?
雪花算法vsRedisIncrement:分布式全局唯一ID生成方案深度对比在分布式系统开发中,“全局唯一ID”是绕不开的核心问题。无论是分库分表的数据库设计、订单编号的唯一性保证,还是日志追踪的链路标识,都需要一套可靠的ID生成方案。今天我们就来聊聊两种主流方案——雪花算法(Snowflake)和RedisIncrement,并从原理、特性到适用场景,帮你理清如何选择。同时,我们还将对比其他常见
【Druid】学习笔记
fixAllenSun
学习 笔记 oracle
【Druid】学习笔记【一】简介【1】简介【2】数据库连接池(1)能解决的问题(2)使用数据库连接池的好处【3】监控(1)监控信息采集的StatFilter(2)监控不影响性能(3)SQL参数化合并监控(4)执行次数、返回行数、更新行数和并发监控(5)慢查监控(6)Exception监控(7)区间分布(8)内置监控DEMO【4】Druid基本配置参数介绍【5】Druid相比于其他数据库连接池的优点
构建高效的物流车辆定位管理系统
体制教科书
本文还有配套的精品资源,点击获取简介:物流车辆定位管理系统利用信息技术提高物流效率和安全性。通过集成GPS技术进行实时车辆追踪和监控,它提供及时的货物运送和异常处理。系统的关键技术包括GPS车辆定位、C#编程语言、数据库管理、车辆管理、在途情况监控、预警与通知、数据分析与报告、用户界面设计、安全性与隐私保护以及系统集成。这些要素共同保障物流流程的高效、安全和智能化。1.物流车辆定位管理系统的应用与
Spring AI Alibaba 快速入门指南(适合初学者)
会飞的架狗师
AI spring 人工智能 java
如果你是刚接触AI开发或Spring框架的初学者,不用担心,本指南会用简单易懂的语言带你一步步了解并使用SpringAIAlibaba。一、什么是SpringAIAlibaba(小白也能懂)简单来说,SpringAIAlibaba就是一个“工具包”,它把阿里巴巴的AI技术(比如通义千问大模型、向量数据库等)和大家常用的Spring框架“打包”到了一起。**打个比方:**就像你想做蛋糕(开发AI应用
Java朴实无华按天计划从入门到实战(强化速战版-66天)
岫珩
Java 后端 java 开发语言 学习 Java 时间安排 学习计划
致敬读者感谢阅读笑口常开生日快乐⬛早点睡觉博主相关博主信息博客首页专栏推荐活动信息文章目录Java朴实无华按天计划从入门到实战(强化速战版-66天)1.基础(18)1.1JavaSE核心(5天)1.2数据库与SQL(5天)1.3前端基础(8天)2.进阶(17天)2.1JavaWeb核心(5天)2.2Mybatis与Spring全家桶(6天)2.3中间件入门(4天)2.4实践项目(2天)3.高阶(1
企业级RAG的数据方案选择 - 向量数据库、图数据库和知识图谱
南七小僧
AI技术产品经理 网站开发 人工智能 数据库 知识图谱 人工智能
如何为企业RAG选择合适的数据存储方式摘要:本文讨论了矢量数据库、图数据库和知识图谱在解决信息检索挑战方面的重要性,特别是针对企业规模的检索增强生成(RAG)。看看海外人工智能企业Writer是如何利用知识图谱增强企业级RAG。要点概要:矢量数据库高效存储数据,但缺乏上下文和关联信息。图数据库优先考虑数据点之间的关系,受益于关系结构。知识图谱在语义存储方面表现出色,由于其能够编码丰富的上下文信息,
小白学习mysql
阿什么名字不会重复呢
mysql 数据库 大数据 人工智能
推荐自学网站不用下载本地环境带自测头歌https://www.educoder.net✅适合基础小白的MySQL简单实用学习计划总学习时间建议:10~14天,每天1小时左右即可最终目标:掌握基础SQL操作,能完成简单项目需求第1阶段:认识数据库与环境搭建(1~2天)你需要学会:•数据库是什么?SQL是什么?•安装MySQLServer+Navicat(推荐用Navicat可视化工具)✅推荐学习内容
Navicat 全面支持金仓数据库 KingbaseES,为金仓生态圈注入新动能
Navicat中国
Navicat 17 焕新上市 Navicat 免费版 数据库
近日,我们宣布Navicat系列产品全面支持中电科金仓(北京)科技股份有限公司旗下金仓数据库管理系统KingbaseES。KingbaseES是面向全行业、全客户关键应用的企业级大型通用融合数据库产品,适用于事务处理类应用、数据分析类应用、海量时序数据采集检索类应用、要求苛刻的互联网等应用场景。这次合作,不仅是Navicat在数据库管理领域的又一重要里程碑,更凭借卓越的技术为金仓数据库的生态注入新
MYSQL:MySQL 事务隔离级别详解
奋斗的狍子007
MySQL核心知识点 mysql 数据库 java spring 架构 spring boot ide
一、MySQL事务是什么? MySQL事务是一组在数据库中执行的操作,这些操作要么全部成功执行,要么全部不执行,以确保数据库的完整性和一致性。事务的ACID 事务具有四个特征:原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)和持续性(Durability)。这四个特性简称为ACID特性。原子性:事务是数据库的逻辑工作单位,事务中包含的各操作要么都做,
免费版 Navicat Premium Lite 17 下载和使用
曼巴不黑
数据库 navicat navicat免费
>>>>>>下载地址以后不需要再为使用Navicat大费周章了,官网已经提供免费版供个人和初创企业使用,认准NavicatPremiumLite。NavicatPremiumLite是Navicat的精简版,它包含了用户执行主要的基本数据库操作所需的核心功能。它允许你同时连接到各种数据库平台,包括MySQL、PostgreSQL、SQLServer、Oracle、MariaDB、Snowflake
Navicat Premium 17.1 的详细使用教程
春云资源
mysql
下载地址:NavicatPremium17.1最新官方版|春云资源#NavicatPremium17.1功能全解析与使用教程指南在当今数字化的时代,数据库管理的高效性与便捷性成为众多企业和开发者追求的目标。NavicatPremium17.1作为一款备受瞩目的数据库管理工具,以其强大的功能和友好的用户界面脱颖而出。以下将为您详细介绍其使用方法,助力您轻松驾驭数据库管理工作。##一、下载与安装流程开
Navicat Premium for Mac 17.1.10 版本重置方案解析
岑铭恩
NavicatPremiumforMac17.1.10版本重置方案解析背景介绍NavicatPremium是一款广受欢迎的数据库管理工具,其Mac版本在17.1.10版本中采用了新的授权验证机制。许多用户在试用期结束后需要重置试用期,但发现传统的重置方法不再适用。本文将深入分析该版本的重置原理和具体操作方案。技术原理分析NavicatPremium17.1.10forMac版本将授权信息存储在用户
TiDB - 分布式数据库的架构与特性
爽新全效瓷兔膏
本文还有配套的精品资源,点击获取简介:TiDB是一个开源的分布式NewSQL数据库,受到了Google的Spanner/F1系统的启发。它提供水平扩展和强一致性事务,适用于需要高可用性和大规模数据处理的场景。TiDB的核心特点包括其分布式架构,由TiDBServer(SQL层)、PDServer(调度器)和TiKVServer(存储引擎)组成;支持无缝的水平扩展和ACID事务;与MySQL高度兼容
MySQL 数据类型详解
yimeixiaolangzai
MySQL mysql 数据库
在数据库设计和开发中,选择合适的数据类型对于存储和操作数据至关重要。MySQL提供了丰富的数据类型来满足不同的数据存储需求,这些数据类型可以分为数值类型、字符串类型、日期和时间类型,以及二进制类型。本文将详细介绍MySQL中的各类数据类型及其应用场景,帮助你更好地进行数据库设计。1.数值类型数值类型用于存储整数和浮点数,在处理数值运算时,这些数据类型扮演着关键角色。MySQL提供了多种数值类型,以
MySQL数据类型详解
永远是少年啊
MySQL mysql 数据库 database
今天继续给大家介绍MySQL相关内容,本文主要内容是MySQL数据类型。MySQL数据库支持多种数据类型,这些数据类型大致可以分为三类:数值型、字符型和时间型。下面将MySQL的具体数据类型介绍如下:一、数值型类型大小(单位:字节)数值范围(有符号)数值范围(无符号)用途TINYINT1(-128,127)(0,255)微整数型SMALLINT2(-32768,32767)(0,65535)小整数
python3中,pycharm中怎么连接数据库
weixin_33736832
数据库 python 开发工具
因为python3现在还不能直接连接数据库,所有如果想连接,就只能通过以下方法:在APP中的,__init__.py中,添加以下代码就可以:importpymysqlpymysql.install_as_MySQLdb()当然前提是,那就的在setting.py中连接数据库添加所连接的mysql数据库的详细信息,如下:DATABASES={'default':{'ENGINE':'django.d
SQL的各种连接查询
xieke90
UNION ALL UNION 外连接 内连接 JOIN
一、内连接
概念:内连接就是使用比较运算符根据每个表共有的列的值匹配两个表中的行。
内连接(join 或者inner join )
SQL语法:
select * fron
java编程思想--复用类
百合不是茶
java 继承 代理 组合 final类
复用类看着标题都不知道是什么,再加上java编程思想翻译的比价难懂,所以知道现在才看这本软件界的奇书
一:组合语法:就是将对象的引用放到新类中即可
代码:
package com.wj.reuse;
/**
*
* @author Administrator 组
[开源与生态系统]国产CPU的生态系统
comsci
cpu
计算机要从娃娃抓起...而孩子最喜欢玩游戏....
要让国产CPU在国内市场形成自己的生态系统和产业链,国家和企业就不能够忘记游戏这个非常关键的环节....
投入一些资金和资源,人力和政策,让游
JVM内存区域划分Eden Space、Survivor Space、Tenured Gen,Perm Gen解释
商人shang
jvm内存
jvm区域总体分两类,heap区和非heap区。heap区又分:Eden Space(伊甸园)、Survivor Space(幸存者区)、Tenured Gen(老年代-养老区)。 非heap区又分:Code Cache(代码缓存区)、Perm Gen(永久代)、Jvm Stack(java虚拟机栈)、Local Method Statck(本地方法栈)。
HotSpot虚拟机GC算法采用分代收
页面上调用 QQ
oloz
qq
<A href="tencent://message/?uin=707321921&Site=有事Q我&Menu=yes">
<img style="border:0px;" src=http://wpa.qq.com/pa?p=1:707321921:1></a>
一些问题
文强chu
问题
1.eclipse 导出 doc 出现“The Javadoc command does not exist.” javadoc command 选择 jdk/bin/javadoc.exe 2.tomcate 配置 web 项目 .....
SQL:3.mysql * 必须得放前面 否则 select&nbs
生活没有安全感
小桔子
生活 孤独 安全感
圈子好小,身边朋友没几个,交心的更是少之又少。在深圳,除了男朋友,没几个亲密的人。不知不觉男朋友成了唯一的依靠,毫不夸张的说,业余生活的全部。现在感情好,也很幸福的。但是说不准难免人心会变嘛,不发生什么大家都乐融融,发生什么很难处理。我想说如果不幸被分手(无论原因如何),生活难免变化很大,在深圳,我没交心的朋友。明
php 基础语法
aichenglong
php 基本语法
1 .1 php变量必须以$开头
<?php
$a=” b”;
echo
?>
1 .2 php基本数据库类型 Integer float/double Boolean string
1 .3 复合数据类型 数组array和对象 object
1 .4 特殊数据类型 null 资源类型(resource) $co
mybatis tools 配置详解
AILIKES
mybatis
MyBatis Generator中文文档
MyBatis Generator中文文档地址:
http://generator.sturgeon.mopaas.com/
该中文文档由于尽可能和原文内容一致,所以有些地方如果不熟悉,看中文版的文档的也会有一定的障碍,所以本章根据该中文文档以及实际应用,使用通俗的语言来讲解详细的配置。
本文使用Markdown进行编辑,但是博客显示效
继承与多态的探讨
百合不是茶
JAVA面向对象 继承 对象
继承 extends 多态
继承是面向对象最经常使用的特征之一:继承语法是通过继承发、基类的域和方法 //继承就是从现有的类中生成一个新的类,这个新类拥有现有类的所有extends是使用继承的关键字:
在A类中定义属性和方法;
class A{
//定义属性
int age;
//定义方法
public void go
JS的undefined与null的实例
bijian1013
JavaScript JavaScript
<form name="theform" id="theform">
</form>
<script language="javascript">
var a
alert(typeof(b)); //这里提示undefined
if(theform.datas
TDD实践(一)
bijian1013
java 敏捷 TDD
一.TDD概述
TDD:测试驱动开发,它的基本思想就是在开发功能代码之前,先编写测试代码。也就是说在明确要开发某个功能后,首先思考如何对这个功能进行测试,并完成测试代码的编写,然后编写相关的代码满足这些测试用例。然后循环进行添加其他功能,直到完全部功能的开发。
[Maven学习笔记十]Maven Profile与资源文件过滤器
bit1129
maven
什么是Maven Profile
Maven Profile的含义是针对编译打包环境和编译打包目的配置定制,可以在不同的环境上选择相应的配置,例如DB信息,可以根据是为开发环境编译打包,还是为生产环境编译打包,动态的选择正确的DB配置信息
Profile的激活机制
1.Profile可以手工激活,比如在Intellij Idea的Maven Project视图中可以选择一个P
【Hive八】Hive用户自定义生成表函数(UDTF)
bit1129
hive
1. 什么是UDTF
UDTF,是User Defined Table-Generating Functions,一眼看上去,貌似是用户自定义生成表函数,这个生成表不应该理解为生成了一个HQL Table, 貌似更应该理解为生成了类似关系表的二维行数据集
2. 如何实现UDTF
继承org.apache.hadoop.hive.ql.udf.generic
tfs restful api 加auth 2.0认计
ronin47
目前思考如何给tfs的ngx-tfs api增加安全性。有如下两点:
一是基于客户端的ip设置。这个比较容易实现。
二是基于OAuth2.0认证,这个需要lua,实现起来相对于一来说,有些难度。
现在重点介绍第二种方法实现思路。
前言:我们使用Nginx的Lua中间件建立了OAuth2认证和授权层。如果你也有此打算,阅读下面的文档,实现自动化并获得收益。SeatGe
jdk环境变量配置
byalias
java jdk
进行java开发,首先要安装jdk,安装了jdk后还要进行环境变量配置:
1、下载jdk(http://java.sun.com/javase/downloads/index.jsp),我下载的版本是:jdk-7u79-windows-x64.exe
2、安装jdk-7u79-windows-x64.exe
3、配置环境变量:右击"计算机"-->&quo
《代码大全》表驱动法-Table Driven Approach-2
bylijinnan
java
package com.ljn.base;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.uti
SQL 数值四舍五入 小数点后保留2位
chicony
四舍五入
1.round() 函数是四舍五入用,第一个参数是我们要被操作的数据,第二个参数是设置我们四舍五入之后小数点后显示几位。
2.numeric 函数的2个参数,第一个表示数据长度,第二个参数表示小数点后位数。
例如:
select cast(round(12.5,2) as numeric(5,2))  
c++运算符重载
CrazyMizzz
C++
一、加+,减-,乘*,除/ 的运算符重载
Rational operator*(const Rational &x) const{
return Rational(x.a * this->a);
}
在这里只写乘法的,加减除的写法类似
二、<<输出,>>输入的运算符重载
&nb
hive DDL语法汇总
daizj
hive 修改列 DDL 修改表
hive DDL语法汇总
1、对表重命名
hive> ALTER TABLE table_name RENAME TO new_table_name;
2、修改表备注
hive> ALTER TABLE table_name SET TBLPROPERTIES ('comment' = new_comm
jbox使用说明
dcj3sjt126com
Web
参考网址:http://www.kudystudio.com/jbox/jbox-demo.html jBox v2.3 beta [
点击下载]
技术交流QQGroup:172543951 100521167
[2011-11-11] jBox v2.3 正式版
- [调整&修复] IE6下有iframe或页面有active、applet控件
UISegmentedControl 开发笔记
dcj3sjt126com
// typedef NS_ENUM(NSInteger, UISegmentedControlStyle) {
// UISegmentedControlStylePlain, // large plain
&
Slick生成表映射文件
ekian
scala
Scala添加SLICK进行数据库操作,需在sbt文件上添加slick-codegen包
"com.typesafe.slick" %% "slick-codegen" % slickVersion
因为我是连接SQL Server数据库,还需添加slick-extensions,jtds包
"com.typesa
ES-TEST
gengzg
test
package com.MarkNum;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.annotation
为何外键不再推荐使用
hugh.wang
mysql DB
表的关联,是一种逻辑关系,并不需要进行物理上的“硬关联”,而且你所期望的关联,其实只是其数据上存在一定的联系而已,而这种联系实际上是在设计之初就定义好的固有逻辑。
在业务代码中实现的时候,只要按照设计之初的这种固有关联逻辑来处理数据即可,并不需要在数据库层面进行“硬关联”,因为在数据库层面通过使用外键的方式进行“硬关联”,会带来很多额外的资源消耗来进行一致性和完整性校验,即使很多时候我们并不
领域驱动设计
julyflame
VO DAO 设计模式 DTO po
概念:
VO(View Object):视图对象,用于展示层,它的作用是把某个指定页面(或组件)的所有数据封装起来。
DTO(Data Transfer Object):数据传输对象,这个概念来源于J2EE的设计模式,原来的目的是为了EJB的分布式应用提供粗粒度的数据实体,以减少分布式调用的次数,从而提高分布式调用的性能和降低网络负载,但在这里,我泛指用于展示层与服务层之间的数据传输对
单例设计模式
hm4123660
java Singleton 单例设计模式 懒汉式 饿汉式
单例模式是一种常用的软件设计模式。在它的核心结构中只包含一个被称为单例类的特殊类。通过单例模式可以保证系统中一个类只有一个实例而且该实例易于外界访问,从而方便对实例个数的控制并节约系统源。如果希望在系统中某个类的对象只能存在一个,单例模式是最好的解决方案。
&nb
logback
zhb8015
log logback
一、logback的介绍
Logback是由log4j创始人设计的又一个开源日志组件。logback当前分成三个模块:logback-core,logback- classic和logback-access。logback-core是其它两个模块的基础模块。logback-classic是log4j的一个 改良版本。此外logback-class
整合Kafka到Spark Streaming——代码示例和挑战
Stark_Summer
spark storm zookeeper PARALLELISM processing
作者Michael G. Noll是瑞士的一位工程师和研究员,效力于Verisign,是Verisign实验室的大规模数据分析基础设施(基础Hadoop)的技术主管。本文,Michael详细的演示了如何将Kafka整合到Spark Streaming中。 期间, Michael还提到了将Kafka整合到 Spark Streaming中的一些现状,非常值得阅读,虽然有一些信息在Spark 1.2版
spring-master-slave-commondao
王新春
DAO spring dataSource slave master
互联网的web项目,都有个特点:请求的并发量高,其中请求最耗时的db操作,又是系统优化的重中之重。
为此,往往搭建 db的 一主多从库的 数据库架构。作为web的DAO层,要保证针对主库进行写操作,对多个从库进行读操作。当然在一些请求中,为了避免主从复制的延迟导致的数据不一致性,部分的读操作也要到主库上。(这种需求一般通过业务垂直分开,比如下单业务的代码所部署的机器,读去应该也要从主库读取数