Comments (1)
Polypheny Tutorial
0.Introduction
Polypheny is an open source and powerful database with easy-to-use, scalable, and flexible data storage architecture. A key characteristic and unique feature of Polypheny is its ability to seamlessly map between different data models. A key characteristic and unique feature of Polypheny is its ability to seamlessly map between different data models. This enables all data to be queried using all supported query languages - independent of the data model the query language is used. independent of the data model the query language is based on.This will simplify the work of programmers. This tutorial will help you understand the design, working principles and basic usage of polypheny database. This tutorial is based on Windows operating system and Java language.
1.Download and install polypheny
Polypheny supports several operating systems, including Linux, Windows and Mac OS X. Before we start learning polypheny, we need to install polypheny first. Here we take Windows as an example:
Click on the download link below: https://github.com/polypheny/Polypheny-DB/releases/tag/v0.9.1
We can see that polypheny offers several installation packages for your system, you can download them as needed.
Once downloaded we click on the installer to start the installation. If you need to change the installation folder, please select the installation location, otherwise just click next and then click install.
You can find polypheny on your desktop after installation.
2.Start polypheny
Double click to open polypheny, the first startup will do some initialization, it may be slow, please be patient.
The console page will be opened automatically after successful startup. Default address:(http://localhost:8080/#/views/monitoring)
Polypheny's Query Interface for drivers and connectors will occupy port: 20591. Please make sure this port is available, or go to the configuration file to change the default port.
3.Using the Visual Console
The web UI console makes polypheny much easier to use, it no longer requires a visual database connection tool. All your configuration changes, server status, load monitoring, and basic data additions, deletions, and modifications can be done through this webUI.
3.1Load Monitoring
You can clearly see the load of your business operations on the home page for real-time server monitoring and adjustment.
3.2Creating Namespaces and Tables
Polypheny separates tables for different businesses through namespaces, similar to other relational databases' databases. polypheny is powerful in that its namespaces support relational, document, and graph.
After creating the namespace, you can click into the namespace to build a table. Everything is visualized and you don't even need to write any SQL statements.
3.3Add, delete, update and select data
Click on data, we can see the specific data in the table.
Clicking on query, we can get a window to write sql statement to manipulate the data.
3.4Settings
3.4.1You can go through the ui interface to set the port, very convenient.
3.4.2You can set the relevant thread parameters of polypheny
3.4.3Partition Settings
There are other settings, which are not described here, waiting for your exploration.
4.Integration of polypheny in the project (base on Java & JDBC)
Like other databases, polypheny supports connectivity via a JDBC driver. it provides a standard interface for executing SQL queries, retrieving results, and managing database connections.
4.1Building a Java Project
Here's a maven project using Idea to go to build so that you can better manage dependencies.
Ensure that your local JDK version and the choice of the same, there is no need to pursue a high version of the JDK.
The pom file configuration, you need to introduce polypheny-jdbc-driver dependency.
Create a new application class file, the name here can be arbitrary, there needs to be a main function in it.
4.2Connection Code
The following is the complete code, where jdbcurl is pointing to your local polypheny, if your port number is not changed then this parameter does not need to be changed, username is defaulted to 'pa' and password is defaulted to "".
public static void main( String[] args ) {
String jdbcUrl = "jdbc:polypheny://localhost:20591";
String username = "pa";
String password = "";
try {
// Load the JDBC driver class
try {
Class.forName( "org.polypheny.jdbc.Driver" );
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
// Establish a connection to the Polypheny database
Connection connection = DriverManager.getConnection( jdbcUrl, username, password );
// Create a statement for executing SQL queries
Statement statement = connection.createStatement();
// Execute an SQL query
String sql = "SELECT * FROM emp";
ResultSet resultSet = statement.executeQuery( sql );
// Process the query results
while (resultSet.next()) {
// Retrieve data from the result set
int id = resultSet.getInt( "employeeno" );
String age = resultSet.getString( "age" );
String gender = resultSet.getString( "gender" );
String workingyears = resultSet.getString( "workingyears" );
String relationshipjoy = resultSet.getString( "relationshipjoy" );
// ...
// Do something with the data
System.out.println( "employeeno: " + id + ", age: " + age + ", gender: "
+ gender+ ", workingyears: " + workingyears+ ", relationshipjoy: " + relationshipjoy);
}
// Close the result set, statement, and connection
resultSet.close();
statement.close();
connection.close();
} catch ( SQLException e ) {
e.printStackTrace();
}
}
The code establishes a JDBC connection and queries the emp table for all the data, then takes out the employeeno, age, etc. fields from it.
Through the console printout we see that the data can be queried normally, so we have successfully connected to the polypheny database. This concludes the tutorial on polypheny.
from polypheny-db.
Related Issues (20)
- Configurable Container Registry & Artifact Repositories
- Allow Wildcards or 'All Tables' specification when adding Data Sources HOT 4
- Add 'Test Connection' on Data Sources HOT 3
- ODBC driver for Polypheny HOT 1
- Polypheny to ODBC adapter
- GIS capabilities
- Clarification and Documentation Request on Cross-Model Queries HOT 2
- Error with Launching Polypheny-DB: Error message about "Something went wrong while restoring query interfaces from the catalog." HOT 5
- Dynamic Reconfiguration for Any Adapter Integration in Polypheny HOT 2
- Issue: Unique Name Field Rejects Valid Input HOT 1
- port 4200 is already in use HOT 2
- Adding Swagger to the backend
- Duplicate registered cypher operator HOT 1
- Jupyter Plugin Initialization Failure in Polypheny DB Environment HOT 5
- Add "Indexes" Document
- Added namespace relationships in Polypheny documentation HOT 1
- Adding new tests for other functions of RequestParser.java file in Http-interface plugin and refactoring the old ones
- Adding tests for the Rest.java file in rest-interface.
- UI display error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polypheny-db.