是不是包含连接池的.JAR包在JBUIDER中没有加进去.把包加进去应该会好.
解决方案 »
- Tomcat 7.0.32 用的不顺手
- log4j如何自动添加到异常中?
- struts2 result 传递参数的问题
- 请教 Spring Security
- 怎样用javascript编写好看点的登陆控件
- IE打印问题
- 如何设置Tomcat的目录为根目录?
- action的问题
- 哪有 微软的 jvm 下载。 急用。 告诉地址给分。
- javax.servlet.ServletException: [Microsoft][ODBC Microsoft Access Driver] ???????? 1?
- 我也来提个问题,webLogic启动时用接续池连接oracle数据库失败
- 关于不同数据类型向数据库提交的问题!!!!!!!!!!!!
你说的有道理,可是,我把commons-collections.jar commons-dbcp.jar commons-pool.jar
都加进去了,还是出现
connection pool successjava.sql.SQLException: Cannot load JDBC driver class 'null'....--------------------------------------------程序代码:
Context initCtx = new InitialContext(); Context ctx = (Context) initCtx.lookup("java:comp/env");
//获取连接池对象
Object obj = (Object) ctx.lookup("jdbc/OracleDB"); System.out.println("connection pool success"); //类型转换 javax.sql.DataSource ds = (javax.sql.DataSource)obj; Connection conn = ds.getConnection(); System.out.println("get connection success");
---------------------------
我不用jbuilder,则tomcat 控制台显示
connection pool success
get connection success
怎么回事儿,请高手继续献策!
2,在输出窗口察看server0808的输出目录
我的jbuilder7是C:/myapp/Tomcat/conf/server8080.xml
3,把这个文件备份,
其中有这样一行
<!--This file, generated by JBuilder, may be deleted and regenerated at any time.-->4,删除这一行,停止web app
5,此时Tomcat目录下没有conf目录了,建立这个目录,将删除了3中这句话的文件放在
conf目录,还叫做server8080.xml,把自己需要的连接池等信息加入6,运行web app,我在jbuilder7中不会替换这个文件。ok...........................
Using a Custom server.xml file with Tomcat in JBuilder
Question: How do a use a custom server.xml with Tomcat in JBuilder 4,5 and 6?Answer:
Make a copy of the JBuilder-generated server.xml file while your Web app
is running, modify the line which says the file was generated by JBuilder,
make you mods, and then AFTER you quit the Web app you were just running,
save your modified copy back to server.xml. After that, JBuilder won't
modify that file.Note: Remember that when you shut down Tomcat you'll need to recreate
the directory that the server.xml file was in before you can save it back out.
After you've made the above modifications, JBuilder will leave the directory
alone.