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...

ehm .. ok.
you do understand we have no idea what tabs you are talking about, right?

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 tested my programme it work, but I want to see by DB under the database section

http://edemmorny.files.wordpress.com/2007/12/nb_services.jpg

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.