Hi Friends this is my code to connect to database oracle10g but i am gettin error when java command the error is invalid oracle url specified can anybody solve this problem
public class condb
public static void main (String args) throws SQLException
What is with people using the DriverManager?
JDBC is recommending that the DataSource interface should be used to create database connection objects instead of using the DriverManager class.
Implementations of the DataSource Interface
The database params can be given as a url. The format of url is
In your case just replace the values as
Connection con=DriverManager.getConnection("jdbc:oracle:thin@ localhost:1521:XE","SYSTEM","tiger");
Try It Out.
javarishi, seems there is a space between @ sign and the word localhost in the URL. ;)
Yaah Eranga, The space need to be deleted. No Space between @ and
Just want to let it know. :)