Getting column and data type information


show more Getting column and data type information provides you with in-depth training on Developer. Taught by David Gassner as part of the Java Database Integration with JDBC show less
please wait ...

Getting column and data type information

I have previously described how to use the database metadata class to get a list of tables from a database. I'm working in a new version of that project named TablesAndColumns where I already have the code to get the list of tables. I'll test it and make sure that I'm successfully retrieving that information. Now I'm going to show you how to get more information from the metadata object, including the names and data types of the database columns. I'll start by re-factoring this code. Instead of immediately outputting the name of each table, I'm going to store the names of the tables in an array list.

I'll start by declaring an array list at the top of the code, I will place my cursor before the try catch block, and I will declare my ArrayList, and I will set its data type to String, that is that's the data type of the items it will contain. And I will name it tables. I will instantiate it with the ArrayList class's no arguments constructor. Now I'll go down to...

Getting column and data type information
Video duration: 5m 55s 2h 51m Intermediate

Viewers:

Getting column and data type information provides you with in-depth training on Developer. Taught by David Gassner as part of the Java Database Integration with JDBC

Subject:
Developer
Software:
Java
Author:
please wait ...