people...  1st: sorry my english...

2nd:
working with JNDI on JSP on the Orion its ok.
but, now i can develop a simple bean with JNDI (with JSDK1.3) and i can't.

whats my objective using this bean.? to reduce redundancy codes. there are
too many jsp files that use the same code to connect to database.

Does Orion implements your own Name Service/or directory Service? does it
use LDAP ? 

how can i develop my bean to work under orion?

above my codes:
-------------------------------------------------------
on JSP, its OK!
<%
javax.naming.Context ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("jdbc/intranet");
Connection con = ds.getConnection();
Statement stmt;
stmt=con.createStatement();
ResultSet rs;
%>
-------------------------------------------------------
here the problems! javac dont find javax.naming...
AND I USE JSDK 1.3!

import java.util.*;
import java.sql.*;
import javax.naming.*;

public class dbBean
{
        String base = new String("jdbc/intranet");
        private Connection dbCon;

        public dbBean()
        { super(); }

        public boolean connect() throws ClassNotFoundException, SQLException
        {
                Context ctx = new InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(base);

                dbCon = ds.getConnection();
                return true;
        }

        public void close() throws SQLException
        {
                dbCon.close();
        }

        public ResultSet execSQL(String sql) throws SQLException
        {
                Statement s= dbCon.createStatement();
                ResultSet r = s.executeQuery(sql);
                return (r==null) ? null : r;
        }

}

-------------------------------------------------
and finally, my data-source.xml on orion dir

<data-source 
        name="intranetAccess"
        class="com.evermind.sql.ConnectionDataSource"
        location="jdbc/intranet"
        pooled-location="jdbc/DefaultPooledDS"
        xa-location="jdbc/xa/DefaultXADS"
        ejb-location="jdbc/DefaultEJBDS"
        url="jdbc:odbc:cfm"
        connection-driver="sun.jdbc.odbc.JdbcOdbcDriver"
        username=""
        password=""
/>

--------------------------------------------------
thanks 4 any reply
_____________________________________________________________________________
Tamer Americo - Conselho Federal de Medicina - CFM
[EMAIL PROTECTED] - ICQ#3221276

"When we are young / Wandering the face of the earth
Wondering what our dreams might be worth / Learning that we're only immortal
For a limited time"
Dreamline - Rush
____________________________________________________________________________
_

Reply via email to