2022.1

Table Of Contents
java.lang.String-java.lang.String-java.lang.String-.
In the returned Connection object normally any public method should be available. The
returned Connection object is described here:
https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html.
Note
Make sure to close any Connection object created by connect() and any other closable
resources created from the Connection instance (ResultSet, etc.).
url
String that represents a database url of the form jdbc:subprotocol:subname, e.g.
'jdbc:mysql://localhost:3306/mycompany'.
The syntax will be specific to the database, or more precisely the JDBC connector. Currently
Datamapper supports the following JDBC connectors:
l com.mysql.cj.jdbc.Driver
l sun.jdbc.odbc.JdbcOdbcDriver
l com.microsoft.sqlserver.jdbc.SQLServerDriver
l oracle.jdbc.OracleDriver
user
String that represents the name of the database user on whose behalf the connection is being
made. This is used for authentication.
password
String that represents the user's password. This is used for authentication.
Example
Here's an example of how to connect to a mySQL database and retrieve a data value.
con = db.connect
('jdbc:mysql://localhost:3306/mycompany','root','admin');
statement = con.createStatement();
values = statement.executeQuery("select * from datavalue");
if (values.next())
values.getString("data");
Page 444