RE:如何连接Oracle数据库?

slylyfox 2003-10-16 03:52:11
我现在在JBoss中通过改写jboss-service.xml、login-config.xml、standardjbosscmp-jdbc.xml和oralce-service.xml后,使缺省的数据库成为Oracle,但我在布置一个Movie的例子的时候报了一串错误:
15:38:54,921 WARN [ServiceController] Problem starting service jboss.j2ee:jndiN
ame=javatheater/Movie,service=EJB
org.jboss.deployment.DeploymentException: Error while creating table MOVIE; - ne
sted throwable: (java.sql.SQLException: Wrong data type: NUMBER in statement [CR
EATE TABLE MOVIE (id NUMBER(10) NOT NULL, title VARCHAR2(255), CONSTRAINT PK_MOV
IE PRIMARY KEY (id))])
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStart
Command.java:175)
......

是什么原因呢?会不会是jdbc驱动的问题?可我已经把classes12.jar和classes12.zip都包在CLASSPATH中了呀!

会手动配置JBoss的大侠们吭一声吧!谢谢了!
...全文
22 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
etre 2003-10-17
  • 打赏
  • 举报
回复
Oracle的JNDI有误啊
给你一个吧ORACLEDB_SERVICE.XML
其他的基本不用改的




<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->

<!-- $Id: oracledb-service.xml,v 1.2.2.5 2002/06/23 21:25:58 d_jencks Exp $ -->


<server>

<!-- ==================================================================== -->
<!-- New ConnectionManager setup for oracle dbs -->
<!-- Build jmx-api (build/build.sh all) and view for config documentation -->
<!-- ==================================================================== -->

<mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=oracleDS">


<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
<mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=oracleDS">

<attribute name="JndiName">OracleDS</attribute>
<attribute name="ManagedConnectionFactoryProperties">
<properties>
<config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@cuipeng:1521:ora8</config-property>
<config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>
<config-property name="UserName" type="java.lang.String">system</config-property>
<config-property name="Password" type="java.lang.String">manager</config-property>
</properties>
</attribute>

<!--Below here are advanced properties -->
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper</depends>
</mbean>
</depends>
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
<mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=oracleDS">

<attribute name="MinSize">0</attribute>
<attribute name="MaxSize">50</attribute>
<attribute name="BlockingTimeoutMillis">5000</attribute>
<attribute name="IdleTimeoutMinutes">15</attribute>
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
reauthentication)-->
<attribute name="Criteria">ByContainer</attribute>
</mbean>
</depends>
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>

<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</depends>

<attribute name="TransactionManager">java:/TransactionManager</attribute>

<!--make the rar deploy! hack till better deployment-->
<depends>jboss.jca:service=RARDeployer</depends>

</mbean>


<!-- Moved to end to test anonymous depends -->
</server>
MichaelXiang 2003-10-16
  • 打赏
  • 举报
回复
没有过,来灌灌水。
UP

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧