Connecting to external database

Ahmed Abd El Hameed 1 month ago updated 1 week ago 6

I am trying to connect to a database to call data from it using java syntax and it works fine on my machine but gives me " Invalid database address " when I try to use the same code in my macro in XTRF , what possibly could be the problem ? the code seems fine as it works on my machine but gives me errors on XTRF, does XTRF have special syntax I will have to follow in order to connect to a database ?

Thanks in advance

It could be that your database is not publicly accessible? Could you maybe share the code?

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Driver;
String url = "jdbc:mysql://myip/mydatabasename" String userName = "username"
String password = "password" Connection conn = DriverManager.getConnection(url,userName,password)

thank you for the quick reply

this works fine on my machine and the IP is publicly accessible yes

Nothing strange to see here indeed. @XTRF team, you probably know the insights of such specific. I'm very interested in what makes this code fail as well.

سلام من با یه بلاگر یا بد افزار طرفم کل سرمایه رفته چطور میتونید کمکم کنید

متأسفانه ما اینجا فارسی صحبت نمی کنیم.

I still didnt find what's wrong, is there anyone who is able to help please? It will be greatly appreciated