In Java you need to write your own SQL-client to query the SQL server, then iterate through all the rows and import them however you want (create new objects, save them in mendix etc)
How to do this is very specific to your particular needs, to get started I'd recommend reading up on writing database clients on the web