0

when i try to connect to a database using macro I get invalid address error

Ahmed Abd El Hameed 2 years ago 0

I try to connect to a database using xtrf macros and I get this error

invalid database address: jdbc:mysql://"HostIp:PortNumber"/"db name"

this is the code I am trying to connect to db with

try {
String url = "jdbc:mysql://host:port/"
String db = "database name"
String userName = "username"
String password = "password"

Connection conn = DriverManager.getConnection(url + db,userName,password)}
catch(Exception e){
return e.getMessage()
}

however the same code works fine on my machine when I try it on Intellij, is there something missing in my code ?