I was able to recreate your issue using the JDBC-ODBC Bridge and the Microsoft SQL Server ODBC driver.
- When retrieving an
nvarchar
value with a leading space from both C# and VBA using the SQL Server ODBC driver the leading space is preserved. - Retrieving that same value from Java via the SQL Server JDBC driver also preserved the leading space.
- However, retrieving that value from Java via the JDBC-ODBC Bridge strips the leading space.
So, it looks like the JDBC-ODBC Bridge is not suitable for your particular project and you may need to locate a JDBC driver for 4D. You might want to start your search here.