databasereferencecheatsheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
databasereferencecheatsheet [2024/01/25 15:51]
wikiadmin [Microsoft SQL Server]
databasereferencecheatsheet [2025/04/22 15:19] (current)
wikiadmin [SQLite]
Line 9: Line 9:
 ====Microsoft SQL Server==== ====Microsoft SQL Server====
  
-The latest JDBC driver can be found at: +The JDBC driver that is compatible with java8 (jre8) could be found at: 
-https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15+ 
 +https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.4.2.jre8/
  
 **Database Driver Class**: com.microsoft.sqlserver.jdbc.SQLServerDriver **Database Driver Class**: com.microsoft.sqlserver.jdbc.SQLServerDriver
Line 21: Line 22:
 ====MySQL==== ====MySQL====
  
-The latest community edition of the JDBC driver can be found at: https://dev.mysql.com/downloads/connector/j/+The JDBC driver that is compatible with java8 could be found at: 
 + 
 +https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/9.2.0/mysql-connector-j-9.2.0.jar  
  
 Note: The MariaDB driver (below) will also work for MySQL Note: The MariaDB driver (below) will also work for MySQL
Line 27: Line 31:
 **Database Driver Class**: com.mysql.cj.jdbc.Driver (this has changed, but older drivers will use com.mysql.jdbc.Driver) **Database Driver Class**: com.mysql.cj.jdbc.Driver (this has changed, but older drivers will use com.mysql.jdbc.Driver)
  
-**Database URL**: <code> jdbc:mysql://hostname/db_name  +**Database URL**: <code>  
-  or, with parameters, such as:   +jdbc:mysql://hostname/db_name, 
- jdbc:mysql://hostname/db_name?socketTimeout=5000&connectTimeout=5000 </code>+or, with parameters, such as:  
 +jdbc:mysql://hostname/db_name?useSSL=false 
 +jdbc:mysql://<hostname>:<port>/<database>?useSSL=false&serverTimezone=UTC 
 +Default port is 3306. The timezone may not be required - depends on the timezone of the server.   
 +jdbc:mysql://hostname/db_name?socketTimeout=5000&connectTimeout=5000 </code>
  
 ====MariaDB==== ====MariaDB====
Line 67: Line 75:
 SQLite is a file based database, so the format of the URL will not include the "hostname". SQLite is a file based database, so the format of the URL will not include the "hostname".
        
-get the latest JDBC driver: https://www.sqlite.org/download.html (the driver is included in the distribution,i.e. sqlite-jdbc-3.27.2.1.jar)+get the latest JDBC driver from SourceForge: 
 +https://sourceforge.net/projects/sqlite-jdbc-driver.mirror/files/latest/download
  
 **Database Driver Class**: org.sqlite.JDBC **Database Driver Class**: org.sqlite.JDBC
  
 **Database URL**: <code> jdbc:sqlite:db_name </code> **Database URL**: <code> jdbc:sqlite:db_name </code>
 +
 +Example: jdbc:sqlite:testdb.sqlite
 +
 +This will create a file called testdb.sqlite in the directory where the application is running. When testing in MIStudio this will be the MIStudio main directory. If you are testing in TransSECS (Builder) this file will appear in the TransSECS/Builder directory.
  
 Note: usually add .sqlite to the file name for SQLite databases, so for example, db_name.sqlite Note: usually add .sqlite to the file name for SQLite databases, so for example, db_name.sqlite
 +
 +====SQL Server Express====
 +
 +The JDBC driver that is compatible with Java 8 could be found at:
 +
 +[[https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.4.2.jre8/]]
 +
 +JDBC needs to be a Jar in the “drivers” directory of the project.  Right-click the “Drivers” node in MIStudio to add it.
 +
 +{{:jarsfiles.jpg?400|}}
 +
 +Choose the first file "mssql-jdbc-12.4.2.jre8.jar" and add it.
 +
 +close the project and reload it after adding the driver, or you can exit MIStudio and restart. 
 +
 +Set MIStudio to LIVE when connecting to the database.
 +
 +
 +**Database Driver Class:** com.microsoft.sqlserver.jdbc.SQLServerDriver
 +
 +**Database URL:** 
 +
 +  jdbc:sqlserver://hostname:1433;databaseName=db_name
 +  
 +  or with parameters, such as:
 +   
 +  jdbc:sqlserver://hostname:1433;databaseName=db_name;encrypt=true;trustServerCertificate=true;
 +
 +
      
  
  
  • databasereferencecheatsheet.1706219474.txt.gz
  • Last modified: 2024/01/25 15:51
  • by wikiadmin