Hi,
I am trying to connect from my J2EE application to a MS SQL Server Database via JDBC.
I am not able to successfully connect, and am getting the following error:
"Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial"
The following code is used to get the connection:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/" + dataSourceName);
conn = ds.getConnection();
The exact same code is working fine within a Web DynPro project, so I don't think there is an issue with JDBC setup on the J2EE Web Server. Do you have any idea as to why I am unable to connect when using a J2EE Application instead?Am I missing something critical?
Thanks in advance,
Michael