Problem with JDBC and JNDI
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   alexeii_bogdan
Posted On:   Wednesday, April 21, 2004 08:38 AM

Hi, i have a problem, i try to connect to mysql server using DataSource and JNDI, but an error is thrown : org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause: java.sql.SQLException: No suitable driver prefix="localhost_syqon_log." suffix=".txt" timestamp="true"/> type="javax.sql.DataSource" /> factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 10000 username password driverClassName    More>>

Hi,
i have a problem, i try to connect to mysql server using DataSource and JNDI, but an error is thrown :

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver








prefix="localhost_syqon_log." suffix=".txt"
timestamp="true"/>


type="javax.sql.DataSource" />


factory
org.apache.commons.dbcp.BasicDataSourceFactory



maxActive
100



maxIdle
30



maxWait
10000



username




password




driverClassName
com.mysql.jdbc.Driver



url
jdbc:mysql://192.168.1.31:3306/test






and my web.xml look like this :


<?xml version="1.0" encoding="UTF-8"?>



.......................


Test Connection
jdbc/test
javax.sql.DataSource
Container



and my aplication look like this:


Context initCtx=new InitialContext();
if(initCtx==null) throw new Exception("InitCtx e null");
Context envCtx=(Context)initCtx.lookup("java:comp/env");
DataSource ds=(DataSource)envCtx.lookup("jdbc/test");
if(ds!=null){
Connection connection=ds.getConnection();
....................................
connection.close();
}


PLZ HELP, IT'S URGENT!!

   <<Less

Re: Problem with JDBC and JNDI

Posted By:   Ibrahim_Shah  
Posted On:   Thursday, May 27, 2004 01:57 PM

What is the exception.

is this is security exception.
About | Sitemap | Contact