lundi 23 février 2015

Connecting Oracle Database to Java Class on server Using JDBC



I currently have a database that runs on Oracle 11g. My plan is to create a jSwing Application that sends request to a server which allows the database to be modified accordingly. The problem is, the server class will not connect to the database. Below is the preferences for the database as shown in Oracle 11g.


http://ift.tt/1JEgreD


The code i am using to connect to this database is shown below:-



Class.forName("oracle.jdbc.driver.OracleDriver");
String URL = "jdbc:oracle:thin:ChrisGraves/<password>@localhost:1521:LettingsAgent";
conn = DriverManager.getConnection(URL);


Can anyone see any reason why my database is not getting connected and, if so, how to rectify the problem. Any cooperation is greatly appreciated. Thank you.




Aucun commentaire:

Enregistrer un commentaire