그림만 보고 따라했다.
0. Introduction
Oracle requires minimal changes from the MySQL configuration except for theusual gotchas :-)
Drivers for older Oracle versions may be distributed as *.zip files ratherthan *.jar files. Tomcat will only use*.jar
files installed in$CATALINA_HOME/common/lib
. Thereforeclasses111.zip
orclasses12.zip
will need to be renamed with a.jar
extension. Since jarfiles are zipfiles, there is no need to unzip and jar thesefiles - a simple rename will suffice.
Some early versions of Tomcat 4.0 when used with JDK 1.4 will not loadclasses12.zip unless you unzip the file, remove thejavax.sql.*
class heirarchy and rejar.
For Oracle 9i onwards you should useoracle.jdbc.OracleDriver
rather thanoracle.jdbc.driver.OracleDriver
as Oracle have statedthatoracle.jdbc.driver.OracleDriver
is deprecated and supportfor this driver class will be discontinued in the next major release.
1. server.xml configuration
In a similar manner to the mysql config above, you will need to define yourDatasource in your server.xml file. Here we define a Datasource called myoracleusing the thin driver to connect as user scott, password tiger to the sidcalled mysid. (Note: with the thin driver this sid is not the same as thetnsname). The schema used will be the default schema for the user scott.
Use of the OCI driver should simply involve a changing thin to oci in the URL string.
<Resource name="jdbc/myoracle" auth="Container" | ||
2. web.xml configuration
You should ensure that you respect the elemeent ordering defined by the DTD when youcreate you applications web.xml file.
<resource-ref> | ||
3. Code example
You can use the same example application as above (asuming you create the required DBinstance, tables etc.) replacing the Datasource code with something like
Context initContext = new InitialContext(); | ||
출처 :www.apache.org
'개발' 카테고리의 다른 글
CSS를 사용할 때의 정렬 : 수평 가운데 정렬 (0) | 2007.03.09 |
---|---|
<img src="http://blogimgs.naver.com/nblog/ico_scrap01.gif" class="i_scrap" width="50" height="15" alt="본문스크랩" /> 자바서비스넷 추천문서 (0) | 2007.03.08 |
TABLE 바로쓰기. (0) | 2007.03.07 |
Google docs. (0) | 2007.03.06 |
ora-01461 can bind a LONG value only for insert into a LONG column (0) | 2007.02.28 |