其他分享
首页 > 其他分享> > Invalid connection string format, a valid format is: "host:port:sid"

Invalid connection string format, a valid format is: "host:port:sid"

作者:互联网

报错信息

Caused by: java.sql.SQLException: Io 异常: Invalid connection string format, a valid format is: "host:port:sid" 
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
    ... 98 more

错误翻译连接字符串格式无效,有效格式为:"主机:端口:sid"

错误原因请检查连接oracle时的格式信息。

连接格式jdbc:oracle:thin:@127.0.0.1:1521:orcl

标签:jdbc,java,string,format,driver,dbcp,connection,oracle,DatabaseError
来源: https://www.cnblogs.com/niceyoo/p/12030154.html