-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a050c7
commit 4efd057
Showing
8 changed files
with
108 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Cli | ||
|
||
FML支持通过Cli(command line interface)访问建模引擎。 | ||
|
||
|
||
## 安装 | ||
|
||
下载fast-modeling-language源码,在根目录下执行 | ||
```shell | ||
mvn clean install -Dmaven.test.skip | ||
``` | ||
|
||
``` | ||
cd fastmodel-driver/fastmodel-driver-cli/target/zip | ||
``` | ||
|
||
## 配置 | ||
|
||
``` | ||
unzip fastmodel-driver-cli-${version}-distribution.zip | ||
``` | ||
|
||
```shell | ||
fastmodel.url=localhost:18080 | ||
fastmodel.ssl=false | ||
fastmodel.database= | ||
fastmodel.password= | ||
fastmodel.user= | ||
``` | ||
|
||
|
||
## 启动 | ||
|
||
```shell | ||
./start.sh | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# JDBC | ||
|
||
FML提供了Driver支持通过JDBC Driver的方式来进行连接使用,主要使用的过程如下: | ||
```plantuml | ||
@startuml | ||
autonumber | ||
actor User | ||
User -> JDBC : 执行FML语句 | ||
JDBC -> 建模引擎 : 通过RPC提交FML语句和上下文信息 | ||
建模引擎 -> FMLSDK : 将FML语句通过SDK转换为FML模型 | ||
建模引擎 -> User : 返回操作结果 | ||
@enduml | ||
``` | ||
|
||
|
||
|
||
# 使用方式 | ||
|
||
## maven引用 | ||
|
||
```xml | ||
<dependency> | ||
<groupId>com.aliyun.fastmodel</groupId> | ||
<artifactId>fastmodel-driver-client</artifactId> | ||
<version>${最新版本}</version> | ||
</dependency> | ||
``` | ||
|
||
|
||
## Demo | ||
|
||
```java | ||
String url = "jdbc:fastmodel://localhost:8082/jdbc"; | ||
|
||
static { | ||
try { | ||
Class.forName("com.aliyun.fastmodel.driver.client.FastModelEngineDriver"); | ||
} catch (ClassNotFoundException e) { | ||
//throw e | ||
} | ||
} | ||
|
||
@Test | ||
public void testConnection() throws SQLException { | ||
Properties properties = getProperties(); | ||
Connection connection = DriverManager.getConnection(url, properties); | ||
Statement statement = connection.createStatement(); | ||
ResultSet resultSet = statement.executeQuery("show tables;"); | ||
assertTrue(resultSet.next()); | ||
String string = resultSet.getString(1); | ||
assertEquals(string, "abc"); | ||
assertFalse(resultSet.next()); | ||
connection.close(); | ||
} | ||
``` |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters