I am new to web development, I have to create a web application in Java using GWT that connects to a database and download a file from it. Regardless of the type of database, what does the web application need in order to create a connection with the database? E.g. an API
Share
You need:
An API to connect to the database in question. The API must support the specific kind of server you are connecting to (MySQL, Oracle, MSSQL, etc) or support a generic protocol (such as ODBC).
Information about the database server, including a hostname or IP of the server, the name of the database, and a username / password of an account on the server. Normally all of this information will be stored in a connection string.
You will probably want some Java code examples to get you started.
Also, as others have said, keep in mind that all database connections are made and maintained by the web server itself. Client pages will NOT be able to access the database directly. However, they can make AJAX requests which in turn cause the server to query a database and return a result for the request.