Search code examples
mysqldatabase-connectioncode-generationtelosys

Telosys cannot connect to database


I am trying to setup Telosys to work with VS Code to generate entities from a MySQL database. But when I type "cdb" to check the connection, it gives the error:

[ERROR] Exception class   : TelosysToolsException
[ERROR] Exception message : Cannot connect to the database (SQLException)

I downloaded a MySQL connector from https://dev.mysql.com/downloads/connector/j/ and selected Platform independent as the platform (I didn't see an option for Windows), then moved the mysql-connector-java-8.0.19 driver file to the lib folder under TelosysTools. The following is my databases.dbcfg file:

<databases defaultId="1" maxId="10">
<db id = "1"
name = "MySql80"
driver = "com.mysql.cj.jdbc.Driver"
url = "jdbc:mysql://localhost:3306/MySQL80"
typeName = "MYSQL"
dialect = "org.hibernate.dialect.MySQLDialect"
poolSize = "3">
    <property name="user" value="root"/>
    <property name="password" value="********"/>
    <metadata catalog=""  schema="****"  
                table-name-pattern="%user" table-types="TABLE VIEW" 
                table-name-exclude=""  table-name-include=""  />
</db>
</databases>

Solution

  • The problem was that I didn't need the MySQL80 at the end of url. Just url="jdbc:mysql://localhost:3306" works.