Weblogic is a middleware software based on JAVAEE architecture that we often use in production. By default, there is no option for Dameng database in weblogic. So how do we use it to connect to DM7? This article will take everyone to practice.
01
Configure weblogic JDBC configuration file, add Dreaming option
Copy the driver (located in the jdbc directory of the Dameng database installation directory, the Dameng 7 JDBC driver is divided into Dm7JdbcDriver14, Dm7JdbcDriver15, Dm7JdbcDriver16, corresponding to Jdk1.4, Jdk1.5, Jdk1.6;) to the %WL_HOME%\server\lib directory Change the %WL_HOME%\server\lib\jdbcDriver.xml file and copy the following code into this file (usually add it to the end of the configuration file).
<Driver
Database="Dameng"
Vendor="Dameng"
Type="Type4"
DatabaseVersion="7.0"
ForXA="true"
Cert="true"
ClassName="dm.jdbc.driver.DmDriver"
URLHelperClassname="weblogic.jdbc.utils.WLDDMSSQLJDBC4DriverURLHelper"
TestSql="SELECT1">
<AttributeName="DbmsName" Required="false"InURL="false"/>
<AttributeName="DbmsHost" Required="true" InURL="true"/>
<AttributeName="DbmsPort" Required="true" InURL="true"DefaultValue="5236"/>
<AttributeName="DbmsUsername" Required="true"InURL="true"/>
<AttributeName="DbmsPassword" Required="true"InURL="true"/>
</Driver>
02
Need to modify bea\weblogic92\common\bin in the weblogic installation directory
commEnv.cmd startManagedWebLogic.cmd two files (corresponding to the .sh script file under the linux operating system)
commEnv.cmd
Add %WL_HOME%\server\lib\Dm7JdbcDriver16.jar after set WEBLOGIC_CLASSPATH=;
startManagedWebLogic.cmd
Add %WL_HOME%\server\lib\Dm7JdbcDriver16.jar after set CLASSPATH=;
03
Start weblogic server to configure Dameng data source
Driver class name:
dm.jdbc.driver.DmDriver
URL:
jdbc:dm://127.0.0.1:5236?ignoreCase=true&user=SYSDBA&password=SYSDBA
If the above URL does not work, change & to &
Attributes:
user=SYSDBA
portNumber=5236
databaseName=DAMENG
serverName=127.0.0.1
Click Test Configuration to prompt the connection test is successful
Open the connection pool to modify the tab
Expand advanced options
Test connection while keeping selected
Fill in DUAL in the two dialog boxes of test table name and initialization sql
Precautions:
1. The user name and password must be passed as parameters. Otherwise, it will prompt the password error when creating.
2. Use & match between parameters to connect, but in the web page & is a special symbol, sometimes the parameter connection string is wrong and the data source cannot be created. So it is safest to use & directly.
3. In the case of the original application oracle, the dream database is generally configured to be case sensitive. In this way, the parameter ignoreCase=true needs to be added to the parameter to ignore the size of the meta-information. Otherwise, errors such as invalid table names or column names will occur during application access.