標籤:查看 介面 password roc art name ble ups rip
(1)建立好本機伺服器:
navicat建立連結:
連結名:自訂,這裡命名為test
配置同jar包
(2)給予登陸許可權,loclhost_3306,右擊選擇“命令列介面”,輸入如下:
create user ‘yonghu‘@‘%‘ identified by ‘mima‘;
GRANT ALL ON mydb1.* TO ‘yonghu‘@‘%‘;
(3)此時雙擊test,便可以串連了。
(4)配置好jar包中的 .properties檔案,配置如下:
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.168.3.215:3306/mydb
spring.datasource.username=java
spring.datasource.password=javatest123
(5)cmd命令列:
java -jar edifact-api-1.1.jar
注意切換到路徑下,可以直接拖動jar包到cmd視窗中。
(6)介面地址:http://192.168.3.215:8080/edif-api
http://192.168.3.215:8080/edif-api?year=95b&trmd=codeco&trsd=ftx
注意用google瀏覽器
如果出現連接埠被佔用:會提示:
Description:
The Tomcat connector configured to listen on port 8080 failed to start. The port
may already be in use or the connector may be misconfigured.
Action:
Verify the connector‘s configuration, identify and stop any process that‘s liste
ning on port 8080, or configure this application to listen on another port.
方法1:
在dos下,輸入 netstat -ano|findstr 8080
在工作管理員中殺死
可以查看哪個進程佔用了8080和8009連接埠,找到佔用連接埠軟體的PID,然後在工作管理員找到對應PID的軟體,關閉結束該進程即可。如果任
務管理器中沒有顯示PID列,需要設定,查看---》選擇列---》勾選“PID(進程標識符)”。
方法2:
修改tomcat預設連接埠號碼。
修改Tomcat的設定檔。
例如:C:/tomcat5.5.25/conf/server.xml
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
Connector 節點,將port="8080"中的連接埠改為一個沒有被佔用的連接埠。
jar 包和 mysql 伺服器部署