# Common Technical Issues

# Windows Startup Error

.\dbapi.ps1 : Cannot load file D:\git\db-api\dist\dbapi-4.0.0-beta\bin\dbapi.ps1 because running scripts is disabled on this system. For more information,
please see https:/go.microsoft.com/fwlink/?LinkID=135170 about_Execution_Policies.
Location Line:1 Character: 1
+ .\dbapi.ps1
+ ~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
  • This is because PowerShell's execution policy does not allow script execution by default and needs to be modified
  • Run PowerShell as administrator and enter set-executionpolicy remotesigned, then choose Y

# SQL Server Connection Failure

  • Different versions of SQL Server have different driver packages and corresponding driver classes. In SQL Server 2000, the statements for loading the driver and URL path are:
String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String dbURL = "jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=sample";
  • While in SQL Server 2005, the statements for loading the driver and URL are:
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String dbURL = "jdbc:sqlserver://localhost:1433; DatabaseName=sample";
  • Incorrect syntax will result in driver not found.

# Ubuntu Startup Error

  • Ubuntu's sh command points to dash by default, please use bash command instead for startup
bash bin/dbapi-daemon.sh start standalone

# Less Than Sign < Error in SQL

  • Similar to MyBatis, the less than sign needs to be escaped. Write the less than sign in SQL as &lt;

# SQL Parameter Passing Does Not Support #{}

  • Some database JDBC drivers do not fully implement the JDBC specification, and the driver does not support dynamic SQL parameter passing (? placeholder parameter passing). Please use a newer version of the driver package (if the new version implements the corresponding JDBC specification), or use ${} instead.

# How to Print API SQL and Parameters in Logs

  • Set in the application.properties file:
logging.level.JdbcUtil=debug

# No Log File After Startup

  • JDK is not installed, please install JDK first