I saw an article in my imarine blog today.ArticleUsing Jena to store the ontology into mysql-documents and examples is a good example, so I 'd like to try it out. The result always throws an exception. Debug found the errorModel
Defmodel = maker. createmodel ("myontology ");In other words, Jena cannot call the createmodel method to create a model. I searched for a lot of content on the Internet. The method was similar, but I was using the latest Jena version, so I ruled out this possibility.
After several explorations, I found that I made a very low-level mistake. Because I have not created a database ontodb In the MySQL database in advanceIdbconnection conn = new dbconnection (strurl, struser, strpassword, strdb );Strurl in (there is a declaration in this sentencePublic static final string strurl
= "JDBC: mysql: // localhost/ontodb ";) Is invalid. So I first create a database ontodb in the database, and then runProgram.
Then it's successful! Celebrate! Applaud! Sahua ~