2 Topics

Member Avatar for
Member Avatar for madhub2v

how to lookup datasource which is created in glassfish with some jndi/dbname name. I am trying to get datasource writing code in a servlet like this Datasource datasource = (Datasource)initialContext.lookup("jdbc/customer"); Connection con = datasource.getConnection(); but it is throwing NameNotFoudExcepion for this context . how can access datasource created outside of …

0
118
Member Avatar for Stefano Mtangoo

Hi, I'm beginning JDBC and I'm conversant in SQL. But I need to Connect to database and that where the problem lies. All I have done is adding mysql/j connector Jar to Netbeans project and wrote code below to test. It cannot connect to database. Also IDE throws error: [CODE=JAVA] …

Member Avatar for Stefano Mtangoo
0
477

The End.