亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > JSP > 正文

JDBC連接Oracle數據庫常見問題及解決方法

2024-09-05 00:21:35
字體:
來源:轉載
供稿:網友

注:本文是斑竹從JDBC & Transaction版摘錄廣大站友的提問以及各種解答整理而來,如果您認為本文的內容已觸犯了您的權益,請聯系管理員進行修改。

  • Jbuilder正確連接 oracle 9i需要注意的幾個問題
  • oracle8以上的應該都使用classes12.jar文件作為jdbc驅動;
  • 正確設置windows的classpath和jbuilder中的enterprise setup 、configure libraries,將casses12.jar路徑正確添加到上述需要設置的地方;
  • 進入database pilot,在database pilot中,file---new 在driver列表中如果oracle的驅動是紅色的,就說明你的oralce在jb中加載失??;
  • 若③沒有錯,則新建一個url:jdbc:oracle:thin:@(yourhostname):1521:(your sid)
  • 連接數據庫的Username/password
  • 注:大部分站友的jbuilder連接oracle的問題都是由于沒有正確配置classpath等引起的。

  • 使用非XA方式連接ORACLE數據庫

    在windows下配置Oracle_XA時要注意兩點:

    #ORACLE 10
    Oracle_XA;xaosw;%ORACLE_HOME% dbms oraxa10.lib%ORACLE_HOME%precompibmsvcorasql10.lib

    #oracle 9
    Oracle_XA;xaosw;%ORACLE_HOME% dbms oraxa9.lib%ORACLE_HOME%precompibmsvcorasql9.lib

    Unix下
    Oracle_XA:xaosw:....

    第一:在windows 下 ORACLE_XA 和xaosw后面的是分號";",不是冒號":"
    第二:上面的這些LIB寫在一行上,中間用空格分開,如果沒有在系統的環境變量中設置ORACLE_HOME,就寫絕對路徑。

  • JDBC操作ORACLE數據庫時出現‘java.sql.SQLException:IO異常,不在流模式下'
  • 用OracleStatment,,不要用java.sql.Statment
  • 如果對已有連接進行setAutoCommit失敗,則關閉該連接并重新建立一個連接
  • 到ORACLE站點下載一個最新的JDBC Driver,如果操作LOB類型,用ORACLE自帶的接口和類
  • weblogic連接oracle問題:The Network Adapter could not establish the connection

    可能是服務器的監聽停掉了,是數據庫的問題,與應用無關;應該先檢查一下oracle是否正常,用sql*plus連接一下數據庫,看能否正常連接;

  • Weblogic中使用Oracle連接池及Oracle備份的注意事項

    使用HP-UNIX,Weblogic 8.1,Oracle 9.2.0.5
    配置了一個普通的連接池,驅動程序采用oracle的Oracle's Driver(Thin) version 9.0.1, 9.2.0

    錯誤情況:
    結果使用數據庫連接池時報錯,說沒有連接池資源了。實際上數據庫的連接池完全空閑,并且測試也是對的,Oracle也是正??梢赃B接、使用的。

    問題根源:
    通過層層排錯,發現原來后臺在使用Oracle的exp備份一個只有同義詞的用戶,導致exp進程僵死。
    殺死exp、重啟Oracle等無法解決問題,最終重啟UNIX,禁止備份只有同義詞的用戶,問題解決。

    總結:
    應該是Oracle9的exp BUG導致連接池問題,不要使用exp倒出同義詞

  • 連接Oracle時拋出如下異常:java.sql.SQLException: Io exception:The Network Adapter could not establish connection一種產生原因

    Oracle Database Connection (from oracle.com)
    PROBLEM
    You are attempting to connect to an Oracle instance using JDBC and you are receiving the following error.
    java.sql.SQLException: Io exception:
    The Network Adapter could not establish connection
    SQLException: SQLState (null) vendor code (17002)
    Any or all of the following conditions may also apply:
    1) You are able to establish a SQL*Plus connection from the same
    client to the same Oracle instance.
    2) You are able to establish a JDBC OCI connection, but not a Thin
    connection from the same client to the same Oracle instance.
    3) The same JDBC application is able to connect from a different
    client to the same Oracle instance.
    4) The same behavior applies whether the initial JDBC connection
    string specifies a hostname or an IP address.
    REDISCOVERY
    To verify whether you are hitting this problem, verify whether the Oracle instance is configured for Multithreaded Server (MTS). If the Oracle instance is not configured for MTS, you are probably encountering a different problem. Otherwise, continue. Try forcing the JDBC connection to use a dedicated server instead of a shared server. This can be accomplished in several ways. For JDBC OCI or Thin, this can be done by reconfiguring the server for dedicated connections only. This approach, however, may not be feasible in many cases. In such cases, the following options apply: For JDBC OCI:
    1) Add the (SERVER=DEDICATED) property to the TNS connect string
    stored in the tnsnames.ora file on the client.
    2) Set the user_dedicated_server=ON in sqlnet.ora on the client.
    For JDBC Thin:
    You must specify a full name-value pair connect string (the same as it might appear in the tnsnames.ora file) instead of the short JDBC Thin syntax. For example, instead of
    "jdbc:oracle:thin::port:sid"
    you would need to use a string of the form
    "jdbc:oracle:thin:@(DESCRIPTION="+
    "(ADDRESS_LIST="+
    "(ADDRESS=(PROTOCOL=TCP)" +
    "(HOST=host)" +=
    "(PORT=port)" +
    ")"+
    ")"+
    "(CONNECT_DATA="+
    "(SERVICE_NAME=sid)"+
    "(SERVER=DEDICATED)"+
    ")"+
    ")"
    If the connection works fine after having made these changes, it is very likely that this is the problem you are encountering. In this case, one last test will help to verify this fact.
    Log into the remote host on which the Oracle instance is running and execute the appropriate command to determine what the server 'thinks' its hostname is (i.e. the name that was configured when the server was installed and configured). For example, on a Unix host the 'hostname' command can be used for this purpose.
    Using the name displayed (e.g. by the hostname command), exactly as it appeared (i.e. if the output from the hostname command had the domain name included, then include it), return to the client which was unable to connect and try pinging the server.
    NOTE: It is critical that you attempt to ping the server using EXACTLY the same hostname you got from the server.
    If you are unable to ping the server via this hostname, then you almost certainly hitting this problem. If not, this may be a new issue, but at least you will have found a workaround (i.e. use a dedicated connection).
    EXPLANATION
    To understand why this problem occurs, one must first understand the differences in how the listener handles connections to shared servers versus dedicated servers.
    When connecting to a dedicated server, the client connects to the listener (via hostname or IP address). The listener then spawns a dedicated server process and hands off the socket used to accept the client connection to that server. The client and server then start communicating via the endpoints established by the initial connection. NOTE: There is only one connection in this case. When connecting to a shared server, the initial client connection to the listener is the same. However, with MTS, there is no need to spawn a new server process; a pool of shared processes already exists. Also, clients do not communicate directly with the server processes in MTS; rather, they communicate with a dispatcher.
    For this reason, when setting up an MTS connection, the listener sends a redirect message back to the client asking the client to close the connection to the listener and connect to a dispatcher. The information in this message includes the hostname and a port number for the appropriate dispatcher. The redirect message will ALWAYS specify a hostname, even if the client initially provided an IP address.
    If, for any reason, the hostname provided to the listener (e.g. by the 'hostname' or another command) doesn't agree with the hostname by which the server is known on the client, the connection fails.
    On the other hand, if "(SERVER=DEDICATED)" already appears in the TNS connect string in tnsnames.ora or if "use_dedicated_server=ON" already appears in the sqlnet.ora file, you may find that SQL*Plus and/or JDBC OCI work fine, while JDBC Thin fails.
    SOLUTION
    Obviously, one solution is to use dedicated servers. However, this may not always be feasible.
    The key is to make sure the hostname on both the client and server agree. This can be accomplished by reconfiguring either the client or the server, but there are things to be aware of in both cases.
    If the server is configured to return a different hostname, then it is possible that other clients which used to work will now fail.
    In some cases, it may not be feasible to reconfigure the client. For example, if the server version of the hostname does not include the domain, you would need to remove the domain portion of the hostname on the client; but, if the client needs to connect to more than one server with the same base name in different domains, this may not be possible, as the hostname may be ambiguous.
    REFERENCES
    bug:1269734 java.sql.SQLException: Io exception: The Network Adapter could not be found.

  • 連接ORACLE數據庫報錯:javax.naming.NameNotFoundException: Unable to resolve oracThin. Resolved: '' Unresolved:'oracThin' ; remaining name ''

    問題描述:配置完JDBC后,打開頁面的時候,報出如下錯誤信息:
    javax.naming.NameNotFoundException: Unable to resolve oracThin. Resolved: '' Unresolved:'oracThin' ; remaining name ''
    JDBC配置如下:
    Connection Pools(連接池)
    Name:OracThin
    URL:jdbc:oracle:thin.0.0.1:LYSIMIS
    Driver Classname:oracle.jdbc.driver.OracleDriver
    Properties:
    user=system
    password=manager
    dll=ocijdbc8
    protocol=thin
    數據源配置如下:
    Name:OracThin
    JNDI Name:OracThin
    Pool Name:OracThin
    當程序執行到這一步時出錯。
    ctx = new InitialContext();
    ds = (javax.sql.DataSource)ctx.lookup ("OracThin");

    問題解決后漢字是亂碼

    錯誤產生原因及解決辦法:

  • URL:jdbc:oracle:thin:.0.0.1:1521:LYSIMI,thin后面加:,127.0.0.1后面加端口號
  • 注意名字大小寫.
  • target 到server上
  • 再看看pool是否起來了,沒起來的話,重起weblogic
  • 亂碼問題(Java是基于Unicode):
  • 在JSP 文件中加入<%@ page contentType="text/html; charset=GBK" %>
  • 在weblogic.xml文件的<jsp-descriptor>部分加入
    <jsp-descriptor>
    <jsp-param>
    <param-name>compilerSupportsEncoding</param-name>
    <param-value>true</param-value>
    </jsp-param>
    <jsp-param>
    <param-name>encoding</param-name>
    <param-value>GBK</param-value>
    </jsp-param>
    </jsp-descriptor>
  • oracle XA的疑惑

    問題描述:Oracle_XA;xaosw;D:oracleora92 dbmsXAORAXA9.lib C:msvcoraSQL9.lib中
    xaosw是什么意思

    解答:可以參考ORACLE的XA部分的文檔。

  • oracle與weblogic自動啟動與停止

    問題描述:每次重新啟動服務器時oracle數據庫若沒有關閉,則必須先關閉后在重新啟動redhat advance server,oracle才能夠正常運行

    原因及解決辦法參見:

    ?forumID=81&threadID=8839&messageID=43184#43184

  • 本文整理的只是本版文章的一小部分,如果這里沒有解答您的問題,請查閱本版的精華區,也可以使用論壇的搜索功能。

    整理日期2005.9.26

    JDBC連接Oracle數據庫常見問題及解決方法

    作者簡介

    dev2dev ID: lhbing, dev2dev論壇版主,WebLoigc以及Java技術愛好者

    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
    亚洲激情第一页| 亚州av一区二区| 色吧影院999| 国内偷自视频区视频综合| 欧美亚洲第一页| 中文字幕v亚洲ⅴv天堂| 国产视频丨精品|在线观看| 精品亚洲国产成av人片传媒| 欧美日韩国产黄| 国产日韩av在线播放| 亚洲男人天堂网站| 中文日韩在线观看| 91美女高潮出水| 一区二区三区黄色| 久久久久久久电影一区| 成人av电影天堂| 欧美成人精品在线观看| 国产亚洲精品久久久久久| 国外日韩电影在线观看| 热re99久久精品国产66热| 亚洲精品电影在线| 91九色国产视频| 亚洲福利视频二区| 日韩av在线影视| 九九热这里只有在线精品视| 欧美日韩在线免费| 亚洲欧美一区二区三区久久| 少妇av一区二区三区| 日韩精品视频在线观看免费| 亚洲精品一区av在线播放| 九九精品在线观看| 亚洲iv一区二区三区| 国产亚洲视频在线| 亚洲第一区在线观看| 国产午夜精品一区理论片飘花| 97视频在线观看成人| 成人中文字幕+乱码+中文字幕| 亚洲老头同性xxxxx| 国外成人在线视频| 国产视频精品免费播放| 成人黄色免费片| 国产精品一区二区久久久久| 国产精品99导航| 国产91精品高潮白浆喷水| 国产丝袜一区二区三区免费视频| 国产www精品| 欧美福利视频网站| 亚洲精品欧美日韩专区| 这里只有精品在线播放| 国产精品色悠悠| 久久久人成影片一区二区三区| 亚洲精品第一页| 91av视频在线免费观看| 国产精品扒开腿做爽爽爽的视频| 国产999精品久久久| 欧美日韩成人精品| 精品女同一区二区三区在线播放| 91久久久久久久一区二区| 欧美裸体xxxx极品少妇| 国产成人亚洲综合91精品| 国产美女久久精品香蕉69| 亚洲欧洲第一视频| 欧美亚洲在线观看| 在线观看中文字幕亚洲| 亚洲欧美精品中文字幕在线| 91麻豆国产精品| 黑人欧美xxxx| 欧美日韩在线视频观看| 亚洲人成伊人成综合网久久久| 欧美性猛交xxxx免费看| 国产精品一区久久久| 国产欧美一区二区白浆黑人| 日韩在线资源网| 中文字幕精品www乱入免费视频| 欧美电影免费观看网站| 日韩av免费一区| 亚洲成人精品视频| 国产精品美女久久久久久免费| 亚洲人成电影网| 国产自产女人91一区在线观看| 日韩一级黄色av| 国产一区二区美女视频| 欧美高清不卡在线| 怡红院精品视频| 精品久久久国产| 欧美日韩电影在线观看| 69久久夜色精品国产69| 久久久久久久久爱| 日韩av在线影院| 成人做爰www免费看视频网站| 日韩精品极品在线观看| 国产91在线播放| 国产一区二区在线免费| 久久久成人av| 日韩在线精品一区| 亚洲欧美国产va在线影院| 日韩久久免费电影| 国产在线日韩在线| 国内免费久久久久久久久久久| 亚洲人精选亚洲人成在线| 91av福利视频| 色先锋资源久久综合5566| 国产精品日韩在线播放| 一本色道久久88综合亚洲精品ⅰ| 成人情趣片在线观看免费| 欧美色另类天堂2015| 成人精品福利视频| 日韩精品视频三区| 国产一区视频在线播放| 欧美日韩免费一区| 奇米一区二区三区四区久久| 精品国产一区av| 日韩视频免费大全中文字幕| 亚洲第一福利在线观看| 亚洲成人网av| 中文字幕精品网| 亚洲自拍高清视频网站| 日韩中文字幕网址| 亚洲男人天堂古典| 国产欧美 在线欧美| 91在线高清视频| 久久久久久久国产精品视频| 成人av在线亚洲| 亚洲无限乱码一二三四麻| 51色欧美片视频在线观看| 国产午夜精品一区理论片飘花| 欧美日韩国产综合视频在线观看中文| 日韩美女在线观看| 日韩免费视频在线观看| 欧美精品中文字幕一区| 亚洲国产精品99| 伊人伊成久久人综合网站| 国产精品96久久久久久| 国产精品久久久久久久久男| 国产成人91久久精品| 91在线视频导航| 91免费高清视频| 中文字幕在线国产精品| 国产成人高清激情视频在线观看| 久久久精品国产亚洲| 免费av一区二区| 91精品国产综合久久久久久蜜臀| 亚洲区一区二区| 日本久久久a级免费| 欧美在线一区二区视频| 欧美专区福利在线| 国产91免费观看| 国产一区二区三区丝袜| 亚洲www永久成人夜色| 亚洲精品久久久一区二区三区| 国产欧美一区二区三区久久人妖| 日本免费一区二区三区视频观看| 最近免费中文字幕视频2019| 亚洲自拍偷拍第一页| 97在线视频免费看| 久久99精品久久久久久琪琪| 91精品国产成人www| 亚洲人成电影网| 在线观看国产精品91| 日韩视频中文字幕| 欧美日韩性生活视频| 欧美亚洲国产视频| 欧美一区二区三区免费观看| 国产亚洲一级高清|