我想我快到了.
我创建了一个AWS BeanStalk实例,并向其中添加了一个Oracle数据库实例.
I created an instance of AWS BeanStalk and added an oracle DB instance to it.
当我找到日志时,我看到驱动程序已加载,但它一直在说URL是 无效的.
When I found the log, I saw the driver was loaded but it keeps saying that URL is invalid.
这是我的RDS信息和日志消息.
Here are my RDS info and log message.
[RDS信息] 端点= aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws 端口= 1521 公共访问=是
[RDS Info] Endpoint = aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws Port = 1521 Public Access = yes
[系统日志]
25-Jun-2018 02:42:56.759 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"] 25-Jun-2018 02:42:56.787 INFO [main] org.apache.tomcat.util.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 25-Jun-2018 02:42:56.796 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"] 25-Jun-2018 02:42:56.799 INFO [main] org.apache.tomcat.util.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 25-Jun-2018 02:42:56.800 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1366 ms 25-Jun-2018 02:42:56.842 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 25-Jun-2018 02:42:56.848 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.50 25-Jun-2018 02:42:56.872 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/ROOT 25-Jun-2018 02:42:58.613 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 25-Jun-2018 02:42:58.689 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 1,817 ms 25-Jun-2018 02:42:58.693 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 25-Jun-2018 02:42:58.720 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 25-Jun-2018 02:42:58.736 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1935 ms Loading driver... Driver loaded! jdbc:oracle:oci://aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws:1521/ebdb?user=username&password=password SQLException: Invalid Oracle URL specified SQLState: 99999 VendorError: 17067 Closing the connection. SQLException: Invalid Oracle URL specified SQLState: 99999 VendorError: 17067 Closing the connection.我将ojdbc8 drvier包含在我的Web项目库中并进行了构建. 这是关于驾驶员的吗?我在做什么错了?
I included ojdbc8 drvier in my web project library and made a build. Is this about driver? What am I doing wrong?
推荐答案消息明确指出您的网址不正确,
Message clearly says your URL is incorrect,
应该是下面的样子.
//step1 load the driver class Class.forName("oracle.jdbc.driver.OracleDriver");
//step1 load the driver class Class.forName("oracle.jdbc.driver.OracleDriver");
//step2 create the connection object Connection con=DriverManager.getConnection( "jdbc:oracle:thin:@aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws:1521:edb","username","password"); `
//step2 create the connection object Connection con=DriverManager.getConnection( "jdbc:oracle:thin:@aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws:1521:edb","username","password"); `
更多推荐
AWS BeanStalk不太倾向于连接到AWS RDS
发布评论