java.sql.SQLException on Connection creation

Greg Chakmakian gregchak at mac.com
Sat Aug 18 11:50:48 EDT 2001


Okay, I finally got the java app to run.  It got through to the point 
where it says "Driver loaded, connecting to database..." and then it 
bombs.  It bombs at the same place with the same error as it was in my 
JSP.

Bombs at:
Connection connection =DriverManager.getConnection( url, login, 
password );

Bombs with error:
Exception- java.lang.NullPointerException
***testjava.sql.SQLException
java.sql.SQLException
         at 
com.internetcds.jdbc.tds.Constructors.newConnection(Constructors.java:305)
         at com.internetcds.jdbc.tds.Driver.connect(Driver.java:257)
         at java.sql.DriverManager.getConnection(DriverManager.java:517)
         at java.sql.DriverManager.getConnection(DriverManager.java:177)
         at TestFreeTDS.main(TestFreeTDS.java:26)


Could someone send me a freetds_jdbc.jar file so I can make sure its not 
what is causing the problem?  Thanks again for everyone's help.  I think 
I'm almost there.

-greg



On Friday, August 17, 2001, at 09:04 AM, Jim Urban wrote:

> Greg,
>  
> Attached is a standalone Java app you can test with.  You will need to 
> make a couple of quick changes to it:
>  
> 1. Change the line String url 
> ="jdbc:freetds:sqlserver://localhost/mydatabase"; to point to the your 
> database server and database.
>  
> 2.  Replace the literal with a valid DB id in the line:  String login = 
> "USERID";.
>
> 3.  Replace the literal with a valid DB password in the 
> line:  .   String password = "PASSWORD";.
> Then recompile the program: javac TestFreeTDS.java.
> Run the program:  java -classpath 
> .;\FreeTDS\freetds_jdbc.jar TestFreeTDS (be sure to set your classpath 
> correctly). 
>  
> Good luck!
>  
> Jim Urban
> Product Manager
> Netsteps Inc.
> Suite 505E
> 1 Pierce Pl.
> Itasca, IL  60143
> Voice:  (630) 250-3045 x2164
> Fax:  (630) 250-3046
>  
>  
>
> -----Original Message-----
> From: bounce-freetds-134788 at franklin.oit.unc.edu 
> [mailto:bounce-freetds-134788 at franklin.oit.unc.edu]On Behalf Of Leon 
> Chakmakian
> Sent: Thursday, August 16, 2001 10:17 PM
> To: TDS Development Group
> Subject: [freetds] Re: java.sql.SQLException on Connection creation
>
> Okay, so here's my status. I tried the snapshot.jar file and I got a 
> different error: No suitable driver found. I later tried re-downloading 
> the file again just to make sure I didn't get a corrupt copy of the 
> file and that didn't work. I tried to make a standalone java app, but 
> I'm not sure how to do that; I come from a JSP type of application 
> background. If you could send me a small sinipit of code to try out as 
> a java app, I could test it that way. I feel like I'm doing something 
> wrong that is really simple. I'm using Tomcat as my JSP engine and have 
> the jar file in my tomcat/lib directory with is specified in my path. 
> Any other ideas? Further below is the error I am getting
>
> -greg
>
>
>
> java.sql.SQLException
> at 
> com.internetcds.jdbc.tds.Constructors.newConnection(Constructors.java:305)
> at com.internetcds.jdbc.tds.Driver.connect(Driver.java:257)
> at java.sql.DriverManager.getConnection(DriverManager.java:517)
>
>
>
>
> On Thursday, August 16, 2001, at 09:24 AM, Curt Hagenlocher wrote:
>
> Should I be using the freetds_jdbc.snapshot.jar file
> instead?
>
>
> Yes, probably, though I don't know that it would make a difference
> in this case.
>
> I'm not really sure where to go next.
> I haven't tried it outside of my JSP environment mainly because I
> don't have anything to try it out on. Any ideas?
>
>
> Create a small source file with a main() function that does
> nothing more than try to make a connection. Build that and
> try to run it outside the JSP context and see if you get the
> same error.
>
> Which JSP environment are you using?
>
> --
> Curt Hagenlocher
> curt at hagenlocher.org
>
> ---
> You are currently subscribed to freetds as: [gregchak at mac.com]
> To unsubscribe, forward this message to leave-
> freetds-134833R at franklin.oit.unc.edu
>
<Attachment missing>> ---
> You are currently subscribed to freetds as: [gregchak at mac.com]
> To unsubscribe, forward this message to leave-
> freetds-134833R at franklin.oit.unc.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 5021 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20010818/64a29467/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestFreeTDS.java
Type: application/octet-stream
Size: 1842 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20010818/64a29467/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 151 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20010818/64a29467/attachment-0001.bin 


More information about the FreeTDS mailing list