Desire to use the DATASOURCE of Oracle in a server of Websphere
with the following JSP code:
<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<%@page import="javax.sql.*"%>
<%@page import="java.util.*"%>
<%@page import="javax.naming.*"%>
<%@page import="javax.servlet.*"%>
<%@page import="com.ibm.db2.jdbc.app.stdext.javax.sql.DataSource"%>
<%@page import="com.ibm.ejs.dbm.jdbcext.*"%>
<%
String query = "select sysdate from dual";
String URL = "jdbc/TEST";
try
{ Hashtable params = new Hashtable();
params.put("java.naming.factory.initial",
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
Context ctx = new InitialContext(params);
com.ibm.db2.jdbc.app.stdext.javax.sql.DataSource ds =
(com.ibm.db2.jdbc.app.stdext.javax.sql.DataSource)ctx.lookup(URL);
java.sql.Connection connection =
ds.getConnection("usertest","passtest");
} catch(Exception e){
out.println(e);
}
%>
but it marks an error to me when executing :
java.sql.Connection connection =
ds.getConnection("usertest","passtest");
obvious this defined " TEST " in the server. Some idea of why ??
> Thanks !!
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets