Wednesday, March 19, 2014

[coding] JDBC bullshit

Me:  Ok Mysql Driver, lets connect to a database!  I made a test table just for you!

Mysql Driver:  no you have to use me from the Driver Manager

Me:  Uh, ok, hey Driver Manager, please give me an instance of...

Driver Manager:  class not found exception!  class not found exception!  we got a class not found exception here!

Me:  Oh fuck.  Ok, Maven, here is a new jar file that the jetty server needs to access

Maven:  Ok.  Wait, what are you doing?  Only the doctor touches me there.  Ow!

Maven:  That's a hardcoded reference in the system namespace!  You shouldn't put your libraries in an easy to find place like source control!  Oh the humanityMaven devs are going to stop supporting this soon because we know better than you.  You should put that jar in a repository.  Is it even open source?  

Maven:  If you aren't using open source you have to spend 6 hours setting up your own maven repository.

Maven:  All software should be open source.  

Maven: ...

Maven:  You see, a long time ago, Richard Stallman tried to print something, and-

Driver Manager:  class not found exception!

Me:  what the hell?

Driver Manager:  you have to tell the Mysql Driver to create an instance of itself so I can find him.  And dont just load the class;  create an instance that you'll never use.  You didn't think that just because we were using reflection I would actually search the classpath for you, did you?

Me:  Ok, Mysql Driver, create an instance of yourself.

Mysql Driver: I'M ALIIIIIIVE.

Me:  I don't suppose you could just go ahead and connect to my-

Mysql Driver:  NO

Me: Driver Manager, please get Mysql Driver for me

Driver Manager:  Allow me to present, dear sir, a driver class fit for a mysql database!  By the laws of the divine factory pattern, I've gone to the trouble of dynamically loading it for you, so that you don't have to load it yourself and you don't have to know which class is being loaded!   Here you go thank you come again.

Me:  Now, Mysql Driver, will you please just connect me to my stupid fucking test database?

Mysql Driver:  SURE I WOULD LOVE TO

Me:  mother fucking cuntbags




[Edit]
Also...JDBC indexes are 1 based.  Who the fuck came up with that?

No comments:

Post a Comment