-->
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.  [ 6 posts ] 
Author Message
 Post subject: IllegalArgumentException: node to traverse cannot be null
PostPosted: Fri Sep 30, 2011 5:59 am 
Newbie

Joined: Fri Sep 30, 2011 5:53 am
Posts: 4
String queryString = "LOAD DATA INFILE 'C:/Documents and Settings/mob100001791/Desktop/vendor1.csv' INTO TABLE vendor1 " ;
session.createQuery(queryString);
when i try to execute the above line i m getting th e following Exception

java.lang.IllegalArgumentException: node to traverse cannot be null!

please get me out of this Exception.

more over please suggest how to convert mysql query into HQL query


Top
 Profile  
 
 Post subject: Re: IllegalArgumentException: node to traverse cannot be null
PostPosted: Fri Sep 30, 2011 8:45 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
That type of query can't be converted to HQL. You might try with session.createSQLQuery(). If that doesn't work either you'll have to use JDBC via session.doWork().


Top
 Profile  
 
 Post subject: Re: IllegalArgumentException: node to traverse cannot be null
PostPosted: Fri Sep 30, 2011 9:24 am 
Newbie

Joined: Fri Sep 30, 2011 5:53 am
Posts: 4
nordborg wrote:
That type of query can't be converted to HQL. You might try with session.createSQLQuery(). If that doesn't work either you'll have to use JDBC via session.doWork().



Hi

We considering DB migration may happen so we should stick with hibernate alone.

when i tried with the following query :
session.createSQLQuery("LOAD DATA INFILE D:/Jiyas/HeatMap/vendor1.csv INTO TABLE vendor1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' ").executeUpdate();

i am getting org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
.....
....
...
Caused by: java.sql.SQLException: No value specified for parameter 1


Last edited by jiyasbasha on Fri Sep 30, 2011 9:29 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: IllegalArgumentException: node to traverse cannot be null
PostPosted: Fri Sep 30, 2011 9:28 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
LOAD DATA INFILE is not very standard in the SQL world, so I doubt that it can work on other database systems than MySQL.


Top
 Profile  
 
 Post subject: Re: IllegalArgumentException: node to traverse cannot be null
PostPosted: Fri Sep 30, 2011 9:32 am 
Newbie

Joined: Fri Sep 30, 2011 5:53 am
Posts: 4
nordborg wrote:
LOAD DATA INFILE is not very standard in the SQL world, so I doubt that it can work on other database systems than MySQL.



my intension is to insert .csv file content which will contain huge data in to mysql data base .

i need query in HQL


Top
 Profile  
 
 Post subject: Re: IllegalArgumentException: node to traverse cannot be null
PostPosted: Fri Sep 30, 2011 10:10 am 
Newbie

Joined: Fri Sep 30, 2011 5:53 am
Posts: 4
when i tried like this

session.createSQLQuery("LOAD DATA LOCAL INFILE :filename INTO TABLE vendor1 FIELDS TERMINATED BY ','(Int_ID, ISIN, COUPON_RTE, FIRST_PY_DTE, ISSU_DTE, LAST_PAYDTE, MATURITY_DTE, NEXT_PAYDATE, PAY_FRQY, PAY_DWN_FAC, DENOM_CURR)").setString("filename", "D:/Jiyas/HeatMap/vendor1.csv").executeUpdate();

csv content is inserted in to DB.

thanks for your response.


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

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.