pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <tfoot id='EGsnT'></tfoot>
    1. <i id='EGsnT'><tr id='EGsnT'><dt id='EGsnT'><q id='EGsnT'><span id='EGsnT'><b id='EGsnT'><form id='EGsnT'><ins id='EGsnT'></ins><ul id='EGsnT'></ul><sub id='EGsnT'></sub></form><legend id='EGsnT'></legend><bdo id='EGsnT'><pre id='EGsnT'><center id='EGsnT'></center></pre></bdo></b><th id='EGsnT'></th></span></q></dt></tr></i><div class="nznrrhx" id='EGsnT'><tfoot id='EGsnT'></tfoot><dl id='EGsnT'><fieldset id='EGsnT'></fieldset></dl></div>

      <legend id='EGsnT'><style id='EGsnT'><dir id='EGsnT'><q id='EGsnT'></q></dir></style></legend>

      <small id='EGsnT'></small><noframes id='EGsnT'>

        • <bdo id='EGsnT'></bdo><ul id='EGsnT'></ul>

      1. 如何修復(fù):“找不到適合 jdbc:mysql://localhost/dbname

        How to fix: quot;No suitable driver found for jdbc:mysql://localhost/dbnamequot; error when using pools?(如何修復(fù):“找不到適合 jdbc:mysql://localhost/dbname 的驅(qū)動程序;使用池時(shí)出錯(cuò)?) - IT屋-程序員軟件開發(fā)技術(shù)分

        1. <small id='rDddk'></small><noframes id='rDddk'>

          <legend id='rDddk'><style id='rDddk'><dir id='rDddk'><q id='rDddk'></q></dir></style></legend>
                • <bdo id='rDddk'></bdo><ul id='rDddk'></ul>

                    <tbody id='rDddk'></tbody>
                  <tfoot id='rDddk'></tfoot>
                • <i id='rDddk'><tr id='rDddk'><dt id='rDddk'><q id='rDddk'><span id='rDddk'><b id='rDddk'><form id='rDddk'><ins id='rDddk'></ins><ul id='rDddk'></ul><sub id='rDddk'></sub></form><legend id='rDddk'></legend><bdo id='rDddk'><pre id='rDddk'><center id='rDddk'></center></pre></bdo></b><th id='rDddk'></th></span></q></dt></tr></i><div class="5bzl7h5" id='rDddk'><tfoot id='rDddk'></tfoot><dl id='rDddk'><fieldset id='rDddk'></fieldset></dl></div>
                • 本文介紹了如何修復(fù):“找不到適合 jdbc:mysql://localhost/dbname 的驅(qū)動程序";使用池時(shí)出錯(cuò)?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試創(chuàng)建到我的數(shù)據(jù)庫的連接,當(dāng)我使用 main 方法測試我的代碼時(shí),它可以無縫地工作.但是,當(dāng)嘗試通過 Tomcat 7 訪問它時(shí),它失敗并顯示錯(cuò)誤:

                  I am trying to create a connection to my database, when I put test my code using the main method, it works seamlessly. However, when trying to access it through Tomcat 7, it fails with error:

                  No suitable driver found for jdbc:mysql://localhost/dbname. 
                  

                  我正在使用池化.我在 WEB-INF/lib 和 .classpath 中放入了 mysql 連接器 (5.1.15)、dbcp (1.4) 和 pool(1.4.5) 庫.我正在使用 Eclipse IDE.我的數(shù)據(jù)庫驅(qū)動程序代碼是:

                  I am using pooling. I put in mysql connector (5.1.15), dbcp (1.4) , and pool(1.4.5) libraries in WEB-INF/lib and in .classpath as well. I am using Eclipse IDE. My code for the database driver is:

                  import java.sql.Connection;
                  import java.sql.DriverManager;
                  import java.sql.SQLException;
                  
                  import org.apache.tomcat.dbcp.dbcp.ConnectionFactory;
                  import org.apache.tomcat.dbcp.dbcp.DriverManagerConnectionFactory;
                  import org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory;
                  import org.apache.tomcat.dbcp.dbcp.PoolingDriver;
                  import org.apache.tomcat.dbcp.pool.impl.GenericObjectPool;
                  
                  public class DatabaseConnector {
                      public static String DB_URI = "jdbc:mysql://localhost/dbname";
                      public static String DB_USER = "test";
                      public static String DB_PASS = "password";
                  
                      // Singleton instance
                      protected static DatabaseConnector _instance;
                  
                      protected String _uri;
                      protected String _username;
                      protected String _password;
                  
                      /**
                       * Singleton, so no public constructor
                       */
                      protected DatabaseConnector(String uri, String username, String password) {
                          _uri = uri;
                          _username = username;
                          _password = password;
                  
                          GenericObjectPool connectionPool = new GenericObjectPool(null);
                          ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
                              _uri, _username, _password);
                          PoolableConnectionFactory poolableConnectionFactory =
                              new PoolableConnectionFactory(connectionFactory, connectionPool,
                                                              null, null, false, true);
                          PoolingDriver driver = new PoolingDriver();
                          driver.registerPool("test", connectionPool);
                      }
                  
                      /**
                       * Returns the singleton instance
                       */
                      public static DatabaseConnector getInstance() {
                          if (_instance == null) {
                              _instance = new DatabaseConnector(DB_URI, DB_USER, DB_PASS);
                          }
                          return _instance;
                      }
                  
                      /**
                       * Returns a connection to the database
                       */
                      public Connection getConnection() {
                          Connection con = null;
                          try {
                              con = DriverManager.getConnection("jdbc:apache:commons:dbcp:test");
                          } catch (SQLException e) {
                              throw new RuntimeException(e);
                          }
                          return con;
                      }
                  }
                  

                  我的堆棧跟蹤的開始:

                  Apr 5, 2011 9:49:14 PM org.apache.catalina.core.StandardWrapperValve invoke
                  SEVERE: Servlet.service() for servlet [Login] in context with path [/Project] 
                  threw exception
                  java.lang.RuntimeException: java.sql.SQLException: 
                  No suitable driver found for jdbc:mysql://localhost/dbname
                  

                  是什么導(dǎo)致了這個(gè)錯(cuò)誤?

                  What is causing this error?

                  推薦答案

                  嘗試將驅(qū)動程序 jar 放在服務(wù)器 lib 文件夾中.($CATALINA_HOME/lib)

                  Try putting the driver jar in the server lib folder. ($CATALINA_HOME/lib)

                  我相信甚至在應(yīng)用程序?qū)嵗熬托枰O(shè)置連接池.(至少在 Jboss 中是這樣的)

                  I believe that the connection pool needs to be set up even before the application is instantiated. (At least that's how it works in Jboss)

                  這篇關(guān)于如何修復(fù):“找不到適合 jdbc:mysql://localhost/dbname 的驅(qū)動程序";使用池時(shí)出錯(cuò)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數(shù)根據(jù) N 個(gè)先前值來決定接下來的 N 個(gè)行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達(dá)式的結(jié)果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數(shù)的 ignore 選項(xiàng)是忽略整個(gè)事務(wù)還是只是有問題的行?) - IT屋-程序員軟件開發(fā)技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時(shí)出錯(cuò),使用 for 循環(huán)數(shù)組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調(diào)用 o23.load 時(shí)發(fā)生錯(cuò)誤 沒有合適的驅(qū)動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫表作為 Spark 數(shù)據(jù)幀讀取?)
                    <tbody id='UnKIR'></tbody>

                  <tfoot id='UnKIR'></tfoot>
                    • <bdo id='UnKIR'></bdo><ul id='UnKIR'></ul>
                    • <i id='UnKIR'><tr id='UnKIR'><dt id='UnKIR'><q id='UnKIR'><span id='UnKIR'><b id='UnKIR'><form id='UnKIR'><ins id='UnKIR'></ins><ul id='UnKIR'></ul><sub id='UnKIR'></sub></form><legend id='UnKIR'></legend><bdo id='UnKIR'><pre id='UnKIR'><center id='UnKIR'></center></pre></bdo></b><th id='UnKIR'></th></span></q></dt></tr></i><div class="lntvpjp" id='UnKIR'><tfoot id='UnKIR'></tfoot><dl id='UnKIR'><fieldset id='UnKIR'></fieldset></dl></div>

                          <small id='UnKIR'></small><noframes id='UnKIR'>

                        1. <legend id='UnKIR'><style id='UnKIR'><dir id='UnKIR'><q id='UnKIR'></q></dir></style></legend>

                          • 主站蜘蛛池模板: 依维柯自动挡房车,自行式国产改装房车,小型房车价格,中国十大房车品牌_南京拓锐斯特房车 - 南京拓锐斯特房车 | 翅片管换热器「型号全」_厂家-淄博鑫科环保 | 钛合金标准件-钛合金螺丝-钛管件-钛合金棒-钛合金板-钛合金锻件-宝鸡远航钛业有限公司 | 单机除尘器 骨架-脉冲除尘器设备生产厂家-润天环保设备 | 空压机商城|空气压缩机|空压机配件-压缩机网旗下商城 | 药品冷藏箱厂家_低温冰箱_洁净工作台-济南欧莱博电子商务有限公司官网 | 浙江红酒库-冰雕库-气调库-茶叶库安装-医药疫苗冷库-食品物流恒温恒湿车间-杭州领顺实业有限公司 | 建筑工程资质合作-工程资质加盟分公司-建筑资质加盟 | [官网]叛逆孩子管教_戒网瘾学校_全封闭问题青少年素质教育_新起点青少年特训学校 | 换网器_自动换网器_液压换网器--郑州海科熔体泵有限公司 | 加热制冷恒温循环器-加热制冷循环油浴-杭州庚雨仪器有限公司 | 仓储货架_南京货架_钢制托盘_仓储笼_隔离网_环球零件盒_诺力液压车_货架-南京一品仓储设备制造公司 | 长沙发电机-湖南发电机-柴油发电机供应厂家-长沙明邦智能科技 | 2025福建平潭岛旅游攻略|蓝眼泪,景点,住宿攻略-趣平潭网 | 断桥铝破碎机_铝合金破碎机_废铁金属破碎机-河南鑫世昌机械制造有限公司 | 液压压力机,液压折弯机,液压剪板机,模锻液压机-鲁南新力机床有限公司 | 宝鸡市人民医院| 搜活动房网—活动房_集装箱活动房_集成房屋_活动房屋 | 蔬菜配送公司|蔬菜配送中心|食材配送|饭堂配送|食堂配送-首宏公司 | 脱硫搅拌器厂家-淄博友胜不锈钢搅拌器厂家 | 杭州用友|用友软件|用友财务软件|用友ERP系统--杭州协友软件官网 | 股指期货-期货开户-交易手续费佣金加1分-保证金低-期货公司排名靠前-万利信息开户 | (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 | 昆明挖掘机修理厂_挖掘机翻新再制造-昆明聚力工程机械维修有限公司 | 江苏全风,高压风机,全风环保风机,全风环形高压风机,防爆高压风机厂家-江苏全风环保科技有限公司(官网) | 臭氧老化试验箱,高低温试验箱,恒温恒湿试验箱,防水试验设备-苏州亚诺天下仪器有限公司 | 卷筒电缆-拖链电缆-特种柔性扁平电缆定制厂家「上海缆胜」 | 小型数控车床-数控车床厂家-双头数控车床 | 贵阳用友软件,贵州财务软件,贵阳ERP软件_贵州优智信息技术有限公司 | 道康宁消泡剂-瓦克-大川进口消泡剂供应商| 电脑刺绣_绣花厂家_绣花章仔_织唛厂家-[源欣刺绣]潮牌刺绣打版定制绣花加工厂家 | 江苏全风,高压风机,全风环保风机,全风环形高压风机,防爆高压风机厂家-江苏全风环保科技有限公司(官网) | 3d可视化建模_三维展示_产品3d互动数字营销_三维动画制作_3D虚拟商城 【商迪3D】三维展示服务商 广东健伦体育发展有限公司-体育工程配套及销售运动器材的体育用品服务商 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 视觉检测设备_自动化检测设备_CCD视觉检测机_外观缺陷检测-瑞智光电 | 防水套管厂家-柔性防水套管-不锈钢|刚性防水套管-天翔管道 | 东亚液氮罐-液氮生物容器-乐山市东亚机电工贸有限公司 | 带压开孔_带压堵漏_带压封堵-菏泽金升管道工程有限公司 | 工装定制/做厂家/公司_工装订做/制价格/费用-北京圣达信工装 | 哲力实业_专注汽车涂料汽车漆研发生产_汽车漆|修补油漆品牌厂家 长沙一级消防工程公司_智能化弱电_机电安装_亮化工程专业施工承包_湖南公共安全工程有限公司 | 一体化隔油提升设备-餐饮油水分离器-餐厨垃圾处理设备-隔油池-盐城金球环保产业发展有限公司 |