Java Mysql connection without Class.forName









up vote
-1
down vote

favorite












I've been trying to connect to a mysql database from java without loading the driver previously with Class.forName (...). With the first i cant connect (No suitable driver found), while with others i can



  • dont work: com.mysql.jdbc_5.1.5.jar

  • work: mysql-connector-java-5.1.6-bin.jar

After seeing the name of the file and seeing that one starts the "com" I would like to know how each one of the drivers works, and because 5.1.5 forces me to load the driver previously and the other does not, thanks










share|improve this question



















  • 1




    It's not clear what you're asking and what your issue is. "...how each one of the controllers works", what is controllers here and what is it you want to know about them. Maybe post some example code of when it isn't working.
    – Joakim Danielson
    Nov 11 at 14:28










  • I was referring to the drivers, the first one does not allow me to connect to the database without using Class.forName, I think it is understood without the need to publish code
    – Rafael Valls
    Nov 11 at 15:21











  • Post text not images please.
    – Joakim Danielson
    Nov 11 at 17:21














up vote
-1
down vote

favorite












I've been trying to connect to a mysql database from java without loading the driver previously with Class.forName (...). With the first i cant connect (No suitable driver found), while with others i can



  • dont work: com.mysql.jdbc_5.1.5.jar

  • work: mysql-connector-java-5.1.6-bin.jar

After seeing the name of the file and seeing that one starts the "com" I would like to know how each one of the drivers works, and because 5.1.5 forces me to load the driver previously and the other does not, thanks










share|improve this question



















  • 1




    It's not clear what you're asking and what your issue is. "...how each one of the controllers works", what is controllers here and what is it you want to know about them. Maybe post some example code of when it isn't working.
    – Joakim Danielson
    Nov 11 at 14:28










  • I was referring to the drivers, the first one does not allow me to connect to the database without using Class.forName, I think it is understood without the need to publish code
    – Rafael Valls
    Nov 11 at 15:21











  • Post text not images please.
    – Joakim Danielson
    Nov 11 at 17:21












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I've been trying to connect to a mysql database from java without loading the driver previously with Class.forName (...). With the first i cant connect (No suitable driver found), while with others i can



  • dont work: com.mysql.jdbc_5.1.5.jar

  • work: mysql-connector-java-5.1.6-bin.jar

After seeing the name of the file and seeing that one starts the "com" I would like to know how each one of the drivers works, and because 5.1.5 forces me to load the driver previously and the other does not, thanks










share|improve this question















I've been trying to connect to a mysql database from java without loading the driver previously with Class.forName (...). With the first i cant connect (No suitable driver found), while with others i can



  • dont work: com.mysql.jdbc_5.1.5.jar

  • work: mysql-connector-java-5.1.6-bin.jar

After seeing the name of the file and seeing that one starts the "com" I would like to know how each one of the drivers works, and because 5.1.5 forces me to load the driver previously and the other does not, thanks







java mysql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 17:39

























asked Nov 11 at 13:37









Rafael Valls

1063




1063







  • 1




    It's not clear what you're asking and what your issue is. "...how each one of the controllers works", what is controllers here and what is it you want to know about them. Maybe post some example code of when it isn't working.
    – Joakim Danielson
    Nov 11 at 14:28










  • I was referring to the drivers, the first one does not allow me to connect to the database without using Class.forName, I think it is understood without the need to publish code
    – Rafael Valls
    Nov 11 at 15:21











  • Post text not images please.
    – Joakim Danielson
    Nov 11 at 17:21












  • 1




    It's not clear what you're asking and what your issue is. "...how each one of the controllers works", what is controllers here and what is it you want to know about them. Maybe post some example code of when it isn't working.
    – Joakim Danielson
    Nov 11 at 14:28










  • I was referring to the drivers, the first one does not allow me to connect to the database without using Class.forName, I think it is understood without the need to publish code
    – Rafael Valls
    Nov 11 at 15:21











  • Post text not images please.
    – Joakim Danielson
    Nov 11 at 17:21







1




1




It's not clear what you're asking and what your issue is. "...how each one of the controllers works", what is controllers here and what is it you want to know about them. Maybe post some example code of when it isn't working.
– Joakim Danielson
Nov 11 at 14:28




It's not clear what you're asking and what your issue is. "...how each one of the controllers works", what is controllers here and what is it you want to know about them. Maybe post some example code of when it isn't working.
– Joakim Danielson
Nov 11 at 14:28












I was referring to the drivers, the first one does not allow me to connect to the database without using Class.forName, I think it is understood without the need to publish code
– Rafael Valls
Nov 11 at 15:21





I was referring to the drivers, the first one does not allow me to connect to the database without using Class.forName, I think it is understood without the need to publish code
– Rafael Valls
Nov 11 at 15:21













Post text not images please.
– Joakim Danielson
Nov 11 at 17:21




Post text not images please.
– Joakim Danielson
Nov 11 at 17:21

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249293%2fjava-mysql-connection-without-class-forname%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249293%2fjava-mysql-connection-without-class-forname%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto