I get the following run time error:
java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
at com.microsoft.jdbcx.base.BaseDataSource.getConnection(Unknown
Source)
at Main.main(Main.java:14)
Exception in thread "main"
I've search the supplied jar files and I can find no reference to SpyLogger
anywhere! Has com/merant/jdbcspy/SpyLogger been left out?
Using DriverManager.getConnection seems to work ok.
Has anyone used the com.microsoft.jdbcx.sqlserver.SQLServerDataSource
approach?
Below is a code snipet of what I'm trying to do..
code (snipet):
import java.sql.*; // import JDBC2.0 core
import javax.sql.*; // import optional package
import javax.naming.*; // jndi naming api
public class Main {
public static void main(String args[]){
try {
com.microsoft.jdbcx.sqlserver.SQLServerDataSource
ds = new com.microsoft.jdbcx.sqlserver.SQLServerDataSource();
ds.setServerName("192.168.0.6:1433");
Connection con = ds.getConnection("sa","");
....
--
Steven Hansen
Sinex Aviaiton Technologies
I just came up with the same problem and was coming here to get an answer
(possibly):
here's my code (not using JNDI obviously):
ssds = new SQLServerDataSource();
ssds.setServerName("192.168.75.203");
ssds.setPortNumber(1433);
ssds.setDatabaseName("shanghai");
ssds.setUser("sa");
ssds.setPassword("p4r4d1s0");
msdatasource = (DataSource) new SQLServerDataSource();
so you see my problem? it's that last line. So the error message you got
was the one i received when (subsequent to having set up the datasource like
this) i called getConnection().
After fixing the code like so:
ssds = new SQLServerDataSource();
ssds.setServerName("192.168.75.203");
ssds.setPortNumber(1433);
ssds.setDatabaseName("shanghai");
ssds.setUser("sa");
ssds.setPassword("p4r4d1s0");
msdatasource = (DataSource) ssds;
I still get the same error.
java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
at com.microsoft.jdbcx.base.BaseDataSource.getConnection(Unknown Source)
at
com.ivianetwork.shanghai.util.ShanghaiConnectionFactory.getConnection(Shangh
aiConnectionFactory)
(ShanghaiConnectionFactory is my class that simply calls getConnection() on
the DataSource)
so we're in the same boat. Anyone?
"Steve Hansen" <bird...@hotmail.com> wrote in message
news:#iH6$y6cBHA.568@tkmsftngp02...
> I've made a post regarding using
> com.microsoft.jdbcx.sqlserver.SQLServerDataSource and a runtime error I
get:
>
> java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
> at com.microsoft.jdbcx.base.BaseDataSource.getConnection(Unknown
> Source)
> at Main.main(Main.java:14)
>
> I also am interested in using this driver for connection pooling and
seeing
> how this is an essential step I'm wonder if anyone else has received this
> error?
>
> Steve Hansen
>
> "Phillip Morelock" <phi...@SPAMivianetwork.com> wrote in message
> news:#7cu0PtbBHA.2036@tkmsftngp02...
> > i'm about to start that myself. keep in touch on this thread if you
come
> > across anything. I'll do the same. Thanks!
> >
> > fillup
> >
> >
> > "Tom Berry" <tbe...@vhb.com> wrote in message
> > news:7af301c16ead$aefbce20$37ef2ecf@TKMSFTNGXA13...
> > > Is anyone implementing connection pooling with the JDBC
> > > driver? If so, what webserver are you using? Any problems
> > > with the driver? I'm currently just using Tomcat 3.2.3.
> > >
> > > Thanks
> > > Tom Berry
> >
> >
>
>
"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...
C:\Temp\tmp>jar -xvf mssqlserver.jar
java.util.zip.ZipException: invalid EXT descriptor signature
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:348)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:144)
at sun.tools.jar.Main.extractFile(Main.java:715)
at sun.tools.jar.Main.extract(Main.java:678)
at sun.tools.jar.Main.run(Main.java:191)
at sun.tools.jar.Main.main(Main.java:904)
"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...
"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...
"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...
I went with a set of wrapper classes that I used to use that would make a
JDBC 1.0 Driver look like a JDBC 2.0 DataSource, and also implements its own
Connection pool. So I'm treating the MS driver as a "dumb" driver (1.0).
Now i'm getting the "cloned connections / transactions" problem everyone
else on this newsgroup has already had ;)
"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...
I guess you are using a jdk 1.2 or higher so this
probably is a security issue.
Security has changed considerably in the Java2 platform,
from a pure sandbox to an access control list (acl)
based security scheme.
Here are the 2 steps for an allow all security policy:
a) provide a java.policy file
---start---
grant {
permission java.security.AllPermission;
};
---stop---
b) add -Djava.security.policy=java.policy to your command that invokes
your application (and your JavaVM as a result)
java -Djava.security.policy=java.policy com.mycompany.MyApplication
In a deployment scenario you should change the allow all to something
more suitable.
With kind regards,
Koen
-----
Koen Van Exem
Projekto – No Cure, No pay!
visit http://www.projekto.com
"Steve Hansen" <bird...@hotmail.com> wrote in message news:<OXkYJv6cBHA.1540@tkmsftngp03>...