Monday, 15 July 2013

mysql - How to connect java to a website/webhost database -



mysql - How to connect java to a website/webhost database -

ok, have been trying connect database client programme web server using java, , specific in question.

i using "serversfree.com" web host hosting database. using latest java run time environment , latest java sdk (javase-1.7 of time of writing). using windows 7 home premium platform writing program.

here trying effort connection web server , database within:

seek { string host = "jdbc:mysql://server17.serversfree.com/database"; string username = "admin"; string password = "example"; connection con = drivermanager.getconnection(host, username, password); } catch(sqlexception e) { system.out.println("there error sql database: " + e.getmessage()); }

i have done research , turns out might need driver connection (seeing getting error output this: "no suitable driver found jdbc:mysql://server17.serversfree.com/database")

output:

there error sql database: no suitable driver found jdbc:mysql://server17.serversfree.com/database

my questions 1.) driver programme talking don't have? , 2.) should go or understand problem?

note: noticed people recommended not utilize microsoft's driver problem, , tried looking jar file called "sqljdbc4.jar", had no luck finding it.

any help appreciated. (anything point me right direction.)

please download suitable driver next link. have download driver operating scheme trying connect.inyour case windows.

mysql driver windows.

the file jar. file need include in classpath while executing program.

java mysql

No comments:

Post a Comment