-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: DriverManager props argument
PostPosted: Tue Oct 04, 2005 5:19 pm 
Beginner
Beginner

Joined: Wed Jun 01, 2005 6:51 pm
Posts: 27
Location: Philippines
Hibernate version:3

I have a JDBC driver for accessing Comma Separated Values text files that accepts properties in a .java class as follows:
Code:
Properties props = new java.util.Properties();

  props.put("separator","|");              // separator is a bar
  props.put("suppressHeaders","true");     // first line contains data
  props.put("fileExtension",".txt");       // file extension is .txt
  props.put("charset","ISO-8859-2");       // file encoding is "ISO-8859-2"

  Connection conn = Drivermanager.getConnection("jdbc:relique:csv:" + args[0],props)



My question for my Hibernate.cfg.xml I have...

Code:
...
<session-factory>
        <property name="hibernate.connection.driver_class">org.relique.jdbc.csv.CsvDriver</property>
        <property name="hibernate.connection.url">jdbc:relique:csv:/AJCS/files/VerdX/Data/DataSources/</property>
        <property name="hibernate.connection.username">sa</property>
       
...
       



if I read the documentation properly I think I would pass the driver specific properties to the CsvDriver as follows:


Code:

<property name="hibernate.connection.separator">|</property>
<property name="hibernate.connection.fileExtension">.txt</property>
<property name="hibernate.connection.suppressHeaders">true</property>
<property name="hibernate.connection.charset">ISO-8859-2</property>



If this is true, and this doesn't work, then the problem I have of the driver not getting these properties, specifically the default file extenstion remains .csv (default) and does not pick up the .txt property, must therefore be in the driver and not Hibernate, yes?

;-)

_________________
Mike "Ollie" Oliver


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.