-
1. Re: jndi MSSQL javax.naming.NoInitialContextException: Need
jfradkin Jun 16, 2003 11:56 AM (in response to jfradkin)I answered my own question after a weekend of reading and punding this until it submitted.
Easy answer was I did not include the library components from client so jndi was not going to work at all.
I ended up with
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:/Drive");
con = ds.getConnection();
Once I had the client jars added.
I also used
<local-tx-datasource>
<jndi-name>Drive</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://192.168.123.110:1433;DatabaseName=wazagua;SelectMethod=cursor</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<user-name>user</user-name>
pass
</local-tx-datasource>
for my mssql-ds.xml
Initially I was getting the not bound error, but I copied the mssql-ds.xml verbatim from an example on this forum and it works great, Note I still have it named drive, boy am I lazy.
Hope this helps any other newb's