On Wednesday, October 12, 2016 at 8:30:06 AM UTC-7, Hector Lucero wrote: > Is there a way to have jdbc and mysql work with ClojureScript? How can you > get to a mysql connection and display selected records from a mysql table > with ClojureScript?
First off welcome to clojure! So clojurescript compiles down to javascript which means it runs on a javascript engine, either in a web browser or on the server side with nodejs. JDBC is what applications running on the java virtual machine(JVM) use to access sql databases. This means that you're not really able to use JDBC with clojurescript (unless you try to run clojurescript in the JVM which while possible I don't know much about and is not common at all). Here are 2 ways to use clojure/clojurescript and access a sql database: 1. Use clojure+jvm+jdbc on the server side to access mysql, and return json or edn to the browser which is running clojurescript. This is pretty well documented, and is how most all applications are constructed. The luminus web framework has lots of great docs on how to accomplish this. http://www.luminusweb.net/ 2. If you would like to run clojurescript on the server side, you should be able to use the same libraries nodejs uses to access mysql(non jdbc), and it should be usable from clojurescript. That said I don't know much about running clojurescript on the server side, and I don't know if it's well documented how to accomplish this. > It seems as though the only database you can use is datomic or just an > atom.... I am completely new to ClojureScript and would like some help > concerning this issue. Not at all clojure/clojurescript are perfect fits for talking to mysql and postgresql and I would say most all applications use sql databases with clojure. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
