私はオラクルをSpringとDBCPに接続することに慣れていません。
<bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@localhost:1521/ORCL" />
<property name="username" value="PMSYSDB" />
<property name="password" value="********" />
</bean>
しかし、私は得る:Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (IO Error: The Network Adapter could not establish the connection)
このプロパティを使用して SQLDeveloper 経由で接続できます。
Hostname: localhost
Port : 1521
SID : ORCL
username: PMSYSDB
password:
私のデータベースは稼働中です... ファイアウォールはオフです... データベースとTomcatは同じマシン上にあります...
重要ではないと思いますが、Spring Security でデータソースを使用します。
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="
select username, password, enabled
from users where username=?"
authorities-by-username-query="
select u.username, ur.authority from users u, user_roles ur
where u.user_id = ur.user_id and u.username =? "
/>
</authentication-provider>
</authentication-manager>