title: How to map standard Java types to SQL types?
body: <p>I want to write a program, which creates RDBMS-tables through JDBC automatically. To add columns to a table, I need to know the name of the column and the column's RDBMS datatype. I already have the names of the columns. I don't have the RDBMS types for the columns, but I have Java types for those column. So I need to map those Java types to RDBMS datatypes. The Java type can be one of the following:</p>
  
  <ul>
  <li>primitve types</li>
  <li>wrapper types of primitive types</li>
  <li><p>String</p></li>
  <li><p>So my question is: How to map those java types to RDBMS types?</p></li>
  <li>Is there a part of JDBC or library that already handles this mapping?</li>
  <li>Are there any classes which can help me partially?</li>
  </ul>
  
  <p>Especially I am working with PostgreSQL. So if there is no genenic way to do it, it would be important for the moment to get it running with PG.</p>
  
  <p>Thanks in advance</p>