Menu

Passing properties in a JNDI resource

Help
2018-05-24
2018-05-24
  • Diego Bosca

    Diego Bosca - 2018-05-24

    Hello,

    I want to configure the same kind of connection properties you can see in
    the Java example such as

    Class.forName("org.relique.jdbc.csv.CsvDriver");
    Properties props = new Properties();
    // Define column names and column data types here.
    props.put("suppressHeaders", "true");
    props.put("headerline", "ID,ANGLE,MEASUREDATE");
    props.put("columnTypes", "Int,Double,Date");
    Connection conn = DriverManager.getConnection("jdbc:relique:csv:" +
    args[0], props);

    but configure them in a JNDI resource? (for tomcat, etc). A typical JNDI
    resource looks like this:

    <Resource name="jdbc/csv" auth="Container" type="javax.sql.DataSource" driverClassName="org.relique.jdbc.csv.CsvDriver" url="jdbc:relique:csv:C:\\csv;" removeAbandoned="true" removeAbandonedTimeout="30" logAbandoned="false" maxActive="500" maxIdle="30" minIdle="20" maxWait="5000"/>

    How can I pass things like supressHeaders or columnTypes?

    Regards

    --

    [image: VeraTech for Health SL] https://htmlsig.com/t/000001C268PZ

    [image: Twitter] https://htmlsig.com/t/000001C47QQH [image: LinkedIn]
    https://htmlsig.com/t/000001C4DPJG [image: Maps]
    https://htmlsig.com/t/000001BZTWS7

    Diego Boscá Tomás / Senior developer
    diebosto@veratech.es
    yampeku@gmail.com

    VeraTech for Health SL
    +34 961071863 <+34%20961%2007%2018%2063> / +34 627015023
    <+34%20627%2001%2050%2023>
    www.veratech.es

    Su dirección de correo electrónico junto a sus datos personales forman
    parte de un fichero titularidad de VeraTech for Health SL (CIF B98309511)
    cuya finalidad es la de mantener el contacto con usted. Conforme a La Ley
    Orgánica 15/1999, usted puede ejercitar sus derechos de acceso,
    rectificación, cancelación y, en su caso oposición, enviando una solicitud
    por escrito a veratech@veratech.es.

     
  • Simon Chenery

    Simon Chenery - 2018-05-24

    You can set database connection properties at the end of the URL string. For example:

    url="jdbc:relique:csv:C:\csv?suppressHeaders=true&headerline=ID,ANGLE,MEASUREDATE&columnTypes=Int,Double,Date"

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.