-4

jdbc.driverClassName = oracle.jdbc.driver.OracleDriver
jdbc.url =jdbc:oracle:thin:@172.16.4.14:1521:amsprod
jdbc.username = licdev
jdbc.password = licdev1234

when i am run this program . console panel showing::
1 .java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

2.Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection

  1. Caused by: java.net.UnknownHostException: gmslora.ceujuntghskx.ap-south- 1.rds.amazonaws.com

this error.

  • https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html – duffymo Mar 14 '17 at 10:35
  • Possible duplicate of [Connect Java to a MySQL database](http://stackoverflow.com/questions/2839321/connect-java-to-a-mysql-database) – KishanCS Mar 14 '17 at 10:37
  • my application previously running on JDBC oracle .now I want to shift MySQL from oracle. if I am changing only JDBC connection code then program is running or change total SQL command...? – Biswajit Mondal Mar 16 '17 at 05:58

1 Answers1

0

Configuration for mysql:

jdbc.driverClassName = com.mysql.jdbc.Driver
jdbc.url = jdbc:mysql://172.16.4.14:3306/amsprod
jdbc.username = licdev
jdbc.password = licdev1234

jdbc:mysql://172.16.4.14:  3306/      amsprod
----------------^host-------^port-----^dbname
Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
  • previously my application configure with oracle database. now I want to switch Mysql from oracle. if i change JDBC property (Configuration for Mysql:) but data base can't access . what is the problem I can't identify . – Biswajit Mondal Mar 14 '17 at 10:59
  • do you create a database in mysql or you want to use the same database of oracle in mysql? @BiswajitMondal ? – Youcef LAIDANI Mar 14 '17 at 11:34
  • ok, then you can make that configuration, do find any problem with this configuration or what @BiswajitMondal – Youcef LAIDANI Mar 14 '17 at 12:45
  • console panel WARN 2017-03-14 17:59:16,487 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] com.mchange.v2.resourcepool.BasicResourcePool - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6ad93be5 -- Last acquisition attempt exception: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458) at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:546) at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:236) at – Biswajit Mondal Mar 14 '17 at 12:48
  • haha, i'm not a magicien, how can i know this problem, you should to explain that in your question, post your error, post your code, so we can understand what is the problem @BiswajitMondal – Youcef LAIDANI Mar 14 '17 at 12:50
  • you can edit your question @BiswajitMondal here http://stackoverflow.com/posts/42783545/edit so put all the necessary information there – Youcef LAIDANI Mar 14 '17 at 12:51
  • my application previously running on JDBC oracle .now I want to shift MySQL from oracle. if I am changing only JDBC connection code then program is running or change total SQL command...? – Biswajit Mondal Mar 16 '17 at 05:55