• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC Remote Database?  RSS feed

 
John Nolette
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to connect to a remote database, but I'm having no luck.
I don't understand how to retrieve the proper connection URL.
This is what I'm trying,


jdbc:mysql://[IP_HERE]/[DB_HERE]/[TABLE_HERE]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think the table name goes into the URL, at least not in all the Mysql setups I've seen.
 
John Nolette
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I don't think the table name goes into the URL, at least not in all the Mysql setups I've seen.


Tried connecting without it, still didn't work.
Though if the table isn't provided, how will it know where to find the specified values?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's part of the SQL statements, not part of the connection.

Can the machine running this code reach the machine running the DB, for example via ping?

What error message are you getting, exactly?
 
John Nolette
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:That's part of the SQL statements, not part of the connection.

Can the machine running this code reach the machine running the DB, for example via ping?

What error message are you getting, exactly?


I'm new to all this, and I own a website and my webhost is quite sturdy in regards to speed.
I'm trying to connect to it's database and read data off a table.

The server is completely accessible, I can run php scripts and read it just fine.

I'm getting a connection error, saying that it cannot establish a connection.
When I use the SQL 'host name', it sais that the username and pw provided don't match.
I'm assuming I somehow need to specify my db atop of that, but I've already tried, and it still doesn't work.

IE: "sql.hostname.org/dbname"
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The details are important. For example, what is the exact error message that you get? (Copy & paste the error message here). And what does your code look like? What exactly does the JDBC URL look like that you're using?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!