Connect to external database like mysql

56 views
Skip to first unread message

SrinivasP EDI Tech Lead

unread,
Oct 19, 2021, 11:26:26 PM10/19/21
to Bots Open Source EDI Translator
Hello

Is it possible to connect external database ex. mysql  and pull the data from database and convert it into EDIFACT message. Can you please let me know anybody worked on this kind of requirement.

Thanks
Srinivas

Eppye Bots

unread,
Oct 20, 2021, 4:30:05 AM10/20/21
to 'Chuck Turco' via Bots Open Source EDI Translator
yes, that is possible.
this email list contains quite some question about it, and there is a plugin that does that.

however, only use this for very very simple exports (one table)
you do not want complex database logic in a bots connector, build a decent exporter.
bots  is written do do translation and communication, not database handling.


kind regards, Henk-Jan Ebbers


--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/b1ddfdfd-ab17-454b-8859-20a6b6f34ff7n%40googlegroups.com.

SrinivasP EDI Tech Lead

unread,
Oct 23, 2021, 2:36:16 AM10/23/21
to Bots Open Source EDI Translator
Thanks for your response. Is there any sample  code available for Mysql database connector 
I am trying to figure out problems which are facing while connecting mysql database using communication script

Thanks 

Eppye Bots

unread,
Oct 23, 2021, 5:37:40 AM10/23/21
to 'Chuck Turco' via Bots Open Source EDI Translator
there is a plugin that connects to database on sourceforge site.
(connects to sqlite database)

kind regards, Henk-Jan Ebbers


p srinivas

unread,
Oct 24, 2021, 5:02:20 AM10/24/21
to bots...@googlegroups.com
Hi

When i am trying to connect MySql database using  Python 2.7 with BOTS , I am getting below error

Process error:
idroute: importarticlesxml
fromchannel:
tochannel: importarticlesxml_out_mysql
errortext: Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\bots\botslib.py", line 333, in wrapper
    terug = func(*args,**argv)
  File "C:\Python27\lib\site-packages\bots\communication.py", line 84, in run
    comclass.run()
  File "C:\Python27\lib\site-packages\bots\communication.py", line 108, in run
    self.connect()
  File "C:\Python27\lib\site-packages\bots\communication.py", line 1639, in connect
    self.dbconnection = botslib.runscript(self.userscript,self.scriptname,'connect',channeldict=self.channeldict)
  File "C:\Python27\lib\site-packages\bots\botslib.py", line 492, in runscript
    raise ScriptError(_(u'Userscript "%(modulefile)s": "%(txt)s".'),{'modulefile':modulefile,'txt':txt})
ScriptError: Userscript "C:\Python27\lib\site-packages\bots\usersys\communicationscripts\importarticlesxml_out_mysql": "Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\bots\botslib.py", line 489, in runscript
    return functiontorun(**argv)
  File "C:\Python27\lib\site-packages\bots\usersys\communicationscripts\importarticlesxml_out_mysql.py", line 15, in connect
    password='Sairam1979!')
  File "C:\Python27\lib\site-packages\mysql\connector\__init__.py", line 265, in connect
    return MySQLConnection(*args, **kwargs)
  File "C:\Python27\lib\site-packages\mysql\connector\connection.py", line 104, in __init__
    self.connect(**kwargs)
  File "C:\Python27\lib\site-packages\mysql\connector\abstracts.py", line 966, in connect
    self._open_connection()
  File "C:\Python27\lib\site-packages\mysql\connector\connection.py", line 292, in _open_connection
    self._ssl, self._conn_attrs)
  File "C:\Python27\lib\site-packages\mysql\connector\connection.py", line 201, in _do_auth
    ssl_options.get('tls_versions'))
  File "C:\Python27\lib\site-packages\mysql\connector\network.py", line 524, in switch_to_ssl
    except ssl.CertificateError as err:
AttributeError: 'module' object has no attribute 'CertificateError'
".

 Is this problem is related Python 2.7 TLS certification update issue. 
Do we need to upgrade the Python 2.7 to newer version as mandatory to resolve this issue?.
 

Thanks and Regards

P. Srinivas
EDI Tech Lead



You received this message because you are subscribed to a topic in the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/botsmail/x7VJ149eFgU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/CAK7Br29P8oy5cDFJR7pbkwrDMH%2BYSC9DCmMS%2BRM4TN9M6S%2B4qA%40mail.gmail.com.

Henk-Jan Ebbers

unread,
Oct 24, 2021, 5:08:21 AM10/24/21
to bots...@googlegroups.com
i have no idea.
this seems to be a db module connection problem, in connecting to mysql db.
(not a Problem that can be solved in bots)

kind regards
Henk-Jan Ebbers

Reply all
Reply to author
Forward
0 new messages