I've created connection on java

when I run the programe I get successful message , however in the service tab next to the project tab I can't see the my database connection under the database

 // inside method

 Connection connection = null;
 String url = "jdbc:oracle:thin@serverName";
 string name ="test";
 string pass ="test"
    Class.forName("com.jdbc.jdbc.OracleDriver");
    if(connection == null){

    Connection con = DriverManager.getConnection(url, name, pass);
    }


return connection; 

Why do you need to see it? Maybe you program terminates after executing that code so you can't see it if your program is not working. If you are connected try to execute some query to se is it working or not...

I didn't work with NetBeans I use Eclipse so i never look at service tab...
Do you work with Glassfish Derby local database? If you don't work with it you can't see it because you just have .jar who connects on database he can't se where it is... It can be in different country...
But if you use Derby you should see under Glassfish...

I don't work with Glassfish that is why it doesn't show

thank u

I didn't work with NetBeans I use Eclipse so i never look at service tab...
Do you work with Glassfish Derby local database? If you don't work with it you can't see it because you just have .jar who connects on database he can't se where it is... It can be in different country...
But if you use Derby you should see under Glassfish...

This article has been dead for over six months. Start a new discussion instead.