java what url value for db driver, using wamp -


i have wamp server , when run it

connection con = drivermanager.getconnection("jdbc:mysql://localhost/mysql", name, password); 

what should value of url?

i mean should end point, think driver file, file?

isn't mysql.exe?

in docs said: database url of form jdbc:subprotocol:subname

but database url?, should in wamp example?

read jdbc...

it should be

"jdbc:mysql://localhost/dbname?" + "user=sqluser&password=sqluserpw" 

where dbname database name, , sqluser, sqluserpw username , password, should store in variables. it's choice whether send plain text or whatever.

edit: have first load driver this:

class.forname("com.mysql.jdbc.driver"); 

further edit: should put these, along mysql statements in function throws exception along lines of try/catch.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -