Skip to main content

Posts

Showing posts with the label JDBC

Using Docker Container for MySQL Service

Problem Suppose you are working on a project that relies on Mysql service but you do not want to install MySQL to your system. Using a Docker image can be a good solution. Remember that you can use many services through Docker containers. Steps 1- Install docker  Docker Community Edition can be freely downloaded from the  official page. It requires registration. https://www.docker.com/community-edition Install docker image. It may require a restart, if it does, do so. In case any problems occur that prevent Docker for Windows from starting check trouble shooting page. https://docs.docker.com/docker-for-windows/troubleshoot/ In Windows 10, hypervisor launch type needs to be "auto".  In order to check current status bcdedit command can be used via PowerShell (Administrator Mode). In order to set to "auto" following command can be used. bcdedit /set hypervisorlaunchtype auto 2- Find the Relevant Container Go to  Docker Store . Type M...

A JDBC Application to Copy Data Across Databases

Requirement It is required to copy data stored in one data source to another data source having the schema structure using JDBC. Whatever data is present in selected tables of origin data source should be copied to destination data source. Challenges Different JDBC drivers require somewhat different URLs and drivers. Even though Java.sql.DriverManager simplifies need to specify correct JDBC driver by looking at the URL, it is still necessary to make sure required driver is in classpath. Furthermore Driver Manager will not be able to load sun’s JdbcOdbcDriver when it is required to access Odbc Data Sources like MS Access DB files, thus it should explicitly be loaded at application startup.  Also there might be situations as it is in MS Access, which requires matching DSN configuration, additional configurations might be necessary.  As to JDBC URLs, since they are not completely standard among different drivers, user needs to know correct construction of req...

Accessing MS Access using JDBC

Since Microsoft does not provide 64 bit drivers for Access; it becomes a nuisance to access MS Access under 64 bit platforms.   For a successfull connection to  MS Access DB File (*.mdb)  with  JDBC  under 64 bit platforms, follow following steps: 1-        Make sure Access drivers are installed. If access is installed it is already there, else download from  this  link and install. 2-        Configure  Data Source Name  using 32 bit  ODBC Data Source Administrator . Use the executable at c:\windows\sysWOW64\odbcad32.exe. 3-        System DSN->Add->Microsoft Access Driver (*.mdb) -            Specify a Data Source Name -            Specify a description -            L...