title: mirth connect: javascript inser xml in mysql
body: <p>I am new to mirth, java script, mysql thing. 
  I have set up a channel in mirth to read a text file and convert it to xml. it works fine.
  I also tried to send the xml to a mysql database using database writer in another channel.</p>
  
  <p>This is what the javascript code looks like</p>
  
  <pre><code>var dbConn = DatabaseConnectionFactory.createDatabaseConnection('com.mysql.jdbc.Driver','jdbc:mysql://192.168.1.4:3306/mirth','root','');
  var result = dbConn.executeUpdate('INSERT INTO jon (xml) values ('1234')');
  dbConn.close();
  </code></pre>
  
  <p>The above code inserts a record in jon table with value of '1234'. but how can I send the xml which I have read through the source:channel reader to the database?
  I have tried to repalce '1234' with ('+messageObject.getEncodedData()+) or rawdata or transformeddata. none of them worked. I get the folowing error:</p>
  
  <pre><code>ERROR (org.mule.impl.DefaultComponentExceptionStrategy:95) .... Wrapped com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;delimited&gt;&lt;row&gt;&lt;column1&gt;1234&lt;/column1&gt;&lt;co' at line 1 (1cf6717f-4818-4b18-acb2-3b93079f2e95#7) .....
  </code></pre>
  
  <p>my intention is to write the whole xml in one field, no parsing needed yet.
  thank you for your patient.
  janmohamamdi</p>