Solution for Jena failure to create a model

Source: Internet
Author: User

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 ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.