• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB deployment problems(urgent pls help)

 
saahil sinha
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am having a problem deploying EJB to suns J2EE server.My problem is that i am using an mssql database using jdbc/odbc driver and i have created a dsn on my window machine.What i dont understand is how do i specify a JNDI name and resource ref for sql database.Suns site explains this with only cloudscape and i just cant seem to understand how to use tht DSN so tht i can use MSSQL database.Also instead of using JNDI name and Datasource object i just want to use the dsn name and use DriverManager.getConnection(jdbc dbc sn_name).
How can i do the above and deploy my ejb app to J2EE.If it is necessary to use only jndi names in suns J2EE server then how exactly can i specify it for my ms sql database.
If J2EE does not support sql which server should i use for deployment.
Please help i am very confused.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You wouldn't use a DSN in a J2EE Application. You would setup a JDBC Datasource and tie it to a JNDI Name. Unfortunately the specifics of how to do this are different for every application server.
When you say you are using Sun's J2EE Server... do you mean the J2EE RI or Sun ONE Application Server?
[ May 04, 2003: Message edited by: Chris Mathews ]
 
sameerleekha
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sahil,
U have a standard way of writing the ejbs which can be deployed on any of the application servers.
In "weblogic-ejb-jar.xml" u will be specifying the JNDI Name of the home interfaces..like:
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>ABCEJB</ejb-name>
<jndi-name>MyJndiName</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
and in the "weblogic-cmp-rdbms-jar.xml" will be specifying the datasource name as:
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>ABCEJB</ejb-name>
<data-source-name>MyDataSource</data-source-name>
</weblogic-rdbms-bean>
For DataSource creating u shoud have to first of all create the connection pool where u will specifying the following parameters:
Name of the Connection Pool: "MyConnPool"
Driver class : "sun.jdbc.odbc.JdbcOdbcDriver"
URL : "jdbc dbc SNNAME"
Now since the connection pool is ready with u, you can create the datasource by providing the following parameters:
Name of the Data Source : MyDataSource
Connection Pool Name : MyConnPool
JNDI-Name : "MyJndiName"
hope above will work..
sameer
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!