A
A
Artyom Smirnov2017-12-29 18:35:25
Java
Artyom Smirnov, 2017-12-29 18:35:25

How to connect to a database over the internet using jdbc?

Hello. I need to connect to a database that is not on my computer. I know the server name, database name, login and password. How much I searched on the Internet - I could not find anything anywhere about connecting to a
NOT local database. Maybe someone from personal experience knows how to connect to the database via the Internet? There are Connection and DriverManager classes with getConnection method (URL, username and password are specified here). But I didn't see the server name in the URL. In general: how does the code look in brief, where the server name is woven in?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-12-29
@sergey-gornostaev

You should work on your search skills. Google for the query "JDBC" produces a huge number of articles and instructions. Here is an example of a section of the official documentation on this topic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question