5 Mesosamerican Themed Party Treats

I am such a nerd. I have become part of a “book club” or sorts for studying Mesoamerican topics in relation to the Book of Mormon.

To kick off our study group, I decided to make some treats, but of course, they had to be Mesoamerican-themed.

We’ve officially named the occassion “Pizzan-Itza”


Here are a few ideas for if you want to throw a Mayan party of your own!

1. Pizzan-Itza: A Mayan Pyramid Pizza

Just get any old pizza and decorate it with toppings to create some mesoamerican design. I opted for creating a Mayan pyramid out of olives. Everyone hated the olives.


On top of a pizza party with pyramid iconography, we needed other treats.

2. Mayan Designed Cookies

I didn’t actually make this for the party last night, but if I had more time I totally would have.

Bake some delicious spice cookies, and let your imagination run wild with Mayan and Aztec designs. If I were doing this one, I would probably make some circular ones that looked like the Mayan or Aztec calendars.

Check out the full instructions here


3. Human Hearts: Balled Watermelon

Just use an ice-cream scoop to create spherical chunks of watermelon and voila! Human Hearts.



4. “Obsidian” Macuahuitl: Preztels with Chocolate Chips

To get the full instructions, click the recipe here!


5. Sun Chips

And to finish it off, we had Sun Chips because it was the Solar Equinox. Mayans were all about solar events and holidays.


And there you have it, a full spread of Mayan/Mesoamerican treats for your nerdy study group on the Book of Mormon.

Mesoamerican Treat: Preztel Macuahuitl

Ever wanted to learn how to make an edible Mesoamerican sword? I’m sure it’s on the top of your bucket list. Well, for my nerdy soulmate out there who’s always wanted to craft treats of ancient civilizations, I’m posting a tutorial!

A macuahuitl (pronounced ma-KWA-weet) is an ancient Mayan weapon used in battle. It was the Mesoamerican equivalent of a sword, but instead of being a thrusting weapon, it was primarily a slashing one. It was typically made of wood, and edged with obsidian blades

Image result for macuahuitl

For us westerners, the idea of a wooden sword doesn’t sound that fearsome. We’re used to sharpened and polished steel-bladed swords. However, these bad boys can really do a number. When wielded by fierce warriors, they could easily hack off human limbs.

Today, we’re going to make an edible equivalent aka preztels with chocolate chips.

It’s a super easy treat to make and is a real crowd-pleaser for Mesoamerican-themed parties!



  • Serving Size: 20 macuahuitls
  • Time: 1 hour


  • 1 package of pretzel rods (I used Snyder’s)
  • 1 package of chocolate chips (semi-sweet or milk)


1. Gather your ingredients

I included peanut butter in this picture because you can use peanut butter as the glue instead of melted chocolate chips, but I opted for the melted chips this time.


2. Lay out your pretzel rods on a cookie sheet or flat surface with wax paper

You’ll want the wax paper because it can get messy and once the “glue” sets, it’s easier to remove the sticks from wax paper than a normal plate.


3. Prep your glue

In my case, I used chocolate chips. Take a small handfull (1/4 cup is more than enough) of chocolate chips, and melt them in a small bowl in the microwave for about 1 minute.

Stir the chips all together until they become a viscous liquid.


4. Start gluing chocolate chips to the sides of each pretzel

Take a tiny dollop of the melted chocolate, and dab it on the bottom of a chocolate chip. Press the chocolate chip to the pretzel, and make sure it’s secure enough so it won’t just fall off.


Repeat this with 3-4 chocolate chips down 1 side of the pretzel


5. Repeat on the other side of the pretzel


6. Freeze

Once you have about 5-10 pretzels made, throw those succors into the freezer on a wax-papered cookie sheet. They only need to be in there for about 5 minutes for the chocolate to solidify and seal the chocolate chips to the pretzel. You can work on the next set of pretzels while the first batch freezes

7. Ta-Da!

That’s it you’re done! You can display your new macuahuitls on a platter, or stick them in some floral foam for a fun display. Have fun slashing human arms with these cool edible mesoamerican swords!




D&C Gospel Doctrine Lesson 20: Three Kingdoms of Glory

This Sunday I taught lesson 20 in the Gospel Doctrine manual for the Doctrine and Covenants. The lesson was on the Three Degrees of Glory, and dovetailed on the previous week’s lesson on the Plan of Salvation.


To begin the lesson, I drew a series of stick-figure scenarios on the board:


Diagram 1: This family – mother, father, and children – are faithful members of the Church and have been sealed under the covenant. However, one of these children decides to leave the church. What happens to this eternal family? Is this family no longer forever?


Diagram 2: This family – mother, father, and children – are faithful members of the Church and have been sealed under the covenant. However, the mother and father got divorced and their sealing was canceled. What happens to the children? Who are they sealed to? Are they eternal orphans?


Diagram 3: This family – mother, father, and children, are faithful members of the Church and have been sealed under the covenant. However, the mother dies and the father is sealed to another woman. When that woman dies, the father is sealed once again to another woman. How does this eternal family work? Is the father an eternal polygamist? Which wife will he be sealed to in the eternities?


Diagram 4: This family – mother, father, and children, are NOT members of the Church, but are members of another faith. However, one of the children finds the Gospel and joins the Church. This child receives all the necessary ordinances for salvation, but cannot be sealed to his family? How can his family be forever?

As it turns out, most people in the Church today are affected by at least one of these situations. Well, spoiler alert, this lesson can’t provide all the answers to all those conundrums. Some of this requires a lot of faith. But learning about the Plan of Salvation and the Three Degrees of Glory can help us understand the mind of God, and help us develop faith in his Plan. The study of D&C 76 can also give us hints to answering some of these difficult questions.

Historical Context


This section is received on February 16, 1832 to Joseph Smith and Sidney Rigdon while in Hiram, Ohio. This revelation came to be known as simply “The Vision” because of its importance in revolutionizing the Church’s theology.


Think about it. This revelation was revered even above the first Vision is the early days of the Church. It was also a complete game-changer. It was even difficult for members of the Church to accept at the time. Brigham Young explained, “My traditions were such, that when the Vision came first to me, it was directly contrary and opposed to my former education. I said, Wait a little. I did not reject it; but I could not understand it.”

Why was it so hard to wrap their minds around? Well, Christian thought up to this point in history focused a lot on a dualistic view of the afterlife: it’s either heaven or hell for you. Heaven was the glorious paradise of the pious few, and Hell was the place reserved for most of us mortals, since we’re all sinners.


By the time the 19th century rolled around, Universalism became wildly popular — this idea that Christ’s grace is sufficient for all, therefore, all are saved regardless of behavior.

As you might imagine, a salvific paradigm where there are multiple options might have been astounding. Not to mention there’s a potential for progression. The most significant doctrine of the revelation, however, was probably the idea that we can become like God (theosis). The concept of theosis was indeed taught in the early Christian church, but fell out of use by around the 5th century.

Now, because Lesson 19 talked all about the basic tenets of the Plan of Salvation, I won’t go into that here. This lesson is just about Exaltation. The Three Degrees of Glory. What happens after judgment.



A good chunk of section 76 has to do with learning about Satan. As it turns out, our Latter-day Saint view of Satan is absolutely unique. This is what D&C 76 has to say about him:


The Latter-day Saint understanding of Satan largely comes from D&C 76. it also comes from a collection of restoration scripture in the Book of Mormon, and the Book of Moses.

Judaism does not foster a concrete idea of Satan with a captial “s.” The ό σατάν or שטן of the Bible is largely viewed as a more generic “adversary” to God in his Divine Council, more than a evil-incarnate devil. Think of it like a prosecuting attorney. There is a designated individual in God’s court assigned to being the opposition to God to help with the decision making process.

Our Latter-day Saint understanding of Satan expands this in teaching that this designated adversary in the Divine Council at some point rebelled against God, opposed his plan, and was cast out of the Divine Council to forever be “the Devil”


We get the sense that by 600 B.C., the average Jew didn’t have the same understanding of Satan that we do in the Mormon church. But wait, didn’t Lehi teach about Satan? Good point. Yes, Lehi did teach about the nature of Satan, but 2 Nephi 2:17 clearly states that Lehi “supposed” that Satan must have been a thing based on his studies. This isn’t some already established truth that Lehi is teaching, but rather a theological expansion based on his own studies and personal revelation.

Three Degrees of Glory


Split the class into 4 groups. Assign each group a block of scripture to read. Have the class members identify unique features of each kingdom.

  • Who will dwell in this kingdom?
  • What is this kingdom like?
  • What is the glory of this kingdom?
  • What part of the godhead can dwell in this kingdom?


After giving class members time to read, go through each kingdom and write their answers on the board.

Outer Darkness


Telestial Glory


Terrestrial Glory


Celestial Glory



Greek Side Note

Sometimes we use 1 Corinthians 15 as a “proof text” for our understanding of the 3 degrees of glory. However, it’s helpful to make sure we’re looking at this scripture in context.


While this scripture appears to be talking about the Celestial and Terrestrial kingdom and the glory of their heralded logos (sun, moon, stars), that is actually just a product of the King James Translation.

When you look at the Greek, what the King James Version translates as “Celestial” is just έπουράνια, or “heavenly.”

What the King James Version translates as “Terrestiral” is the word έπίγεια, or “earthly”.

All Paul is saying, is that the glory of heavenly things compares to the glory of earthly things in the way that the glory of the sun differs from the moon.

Still a beautiful concept. Just not proof that Paul was teaching the Three Degrees of Glory.



Bring together the whole conversation by asking the class why we should learn about the Plan of Salvation. What is it about the Three Degrees of Glory that gives us hope?


I think that the most important reason to study the Three Degrees of Glory, is that as we do so, we more fully recognize the magnitude and mercy of the Atonement. Jesus Christ suffered all, so that we could become as glorious as Him. He suffered for our sins so that we could enter into His presence and eventually become as gods. Because he loves us.



New Video on Book of Mormon Evidence

So I work for Book of Mormon Central and I love the Book of Mormon. You should check out our website!

We just came out with this amazing new video on Nahom, and how it provides archaeological evidence for the Book of Mormon. And this is the blog post I wrote for them:

This video is part of a new and exciting video initiative by Book of Mormon Central. This particular video has brought together what we know about the Book of Mormon place of “Nahom.” As it turns out, archaeologists have been able to find and positively identify Nahom in southern Arabia. The site at Nahom even dates back to Lehi’s time period. Stephen Smoot at Book of Mormon Central walks viewers through the discovery of Nahom and what it means for Book of Mormon evidence.

For a little background, Nahom is mentioned only once in the Book of Mormon, in 1 Nephi 16:34, during Lehi’s journey to the promised land:

And it came to pass that Ishmael died, and was buried in the place which was called Nahom.

When Ishmael passed away on their journey, Nephi implied that the place where they buried Ishmael already had a name. If the place was called Nahom back in Lehi’s time, you’d expect to be able to find it in the archaeological record, and that’s exactly what we find in southern Arabia, along Lehi’s trail.

An altar from Nehem with the inscription “NHM”

In southwestern Arabia, one can find a small settlement called Nehem. At first, people were unsure if “Nehem” could really be the same place as “Nahom” mentioned in the Book of Mormon. However, in 1997, German archaeologists discovered an altar that dated back to Lehi’s time, with an inscription containing the name “NHM.”

This site in southwestern Arabia not only is supported by the archaeological record, but it fits perfectly into Nephi’s story. Nehem was one of the largest burial places in ancient southwestern Arabia, making it the perfect location for Ishmael’s burial. After Lehi and his group left Nahom 1 Nephi 17:1 tells us that:

we did travel nearly eastward from that time forth

As it turns out, if you travel east from Nehem you’ll end up right on the coast, at a location that perfectly fits Nephi’s description of Bountiful.

The discovery of Nahom may be one of the strongest pieces of evidence we have for the Book of Mormon, but it is far from being the only one. Time and time again, the Book of Mormon has proven true to its claims.

For more information, be sure to read our KnoWhy article on Nahom!

Soap Carving

Today I decided it would be a fun idea to try some soap carving. This is a great activity to do with your kids. I don’t have any kids. I don’t have a husband. I don’t have a single good excuse for wanting to try soap carving. But I don’t need an excuse. I soap carved. It was great. I made a fish.

You want to know how to soap carve? It’s really pretty easy, and super fun. If you’ve never done carving or whittling before, soap is a great medium to start on because it’s soft, malleable, and forgiving. You really don’t need any fancy knives; soap is soft enough that you can even use plastic knives!


  • Bar of Soap
    • Ivory is a great brand to use – soft and cheap
  • Knife
    • Could be plastic knife or butter knife. I used a metal butter knife
  • X-acto Knife
    • This one is optional for basic patterns. I used the X-acto Knife at the end for some detail work
  • Paper for carving pattern
  • Pencil, toothpick, or pointy object for tracing on to the soap
  • Scissors for cutting out the patter

That’s it! I already had all these materials at my house. The only thing I had to purchase was the X-acto knife, and I quickly discovered that it was pretty optional.


Step 1

Cut out and trace the pattern

You can print out a free, downloadable pattern that I created here.

fish-pattern printable PDF


However, if you don’t want to use a pre-made template, that’s totally fine, just draw your own!

You’ll just want to make sure that your pattern matches the dimensions of your soap bar, and that you account for not only the top of the bar, but the shape of the sides as well.

The dimensions of the Ivory bar I used were 3.1875″ x 2.125″ x 1″


Step 2

Once you have your pattern either drawn or printed out, cut it out, and lay it ontop of your unwrapped soap bar. Take your pencil or toothpick and trace the outline of your pattern onto the soap. It does actually mark the soap, it just creates inscribed lines.


Step 3

Now comes the fun part. With your pattern laid out on your soap bar, you are all set to start carving!


With your knife, start carving along the outline you drew. It doesn’t have to be super precise, as you’ll be refining the cut a lot more later. Just get the basic outline chiseled out of the block. Remember when it comes to carving, less is more. You can’t exactly add soap back on to the block once you chop it off, so be conservative in your chiseling at first.

Step 4

Once your basic shape has emerged from the block you can proceed with the refining of your shape. This is the part that takes the most patience and skill. Thankfully, soap is a really easy medium for beginners, but it still takes a lot of time and precision to slowly work away at the rough edges to create something smooth and more realistic.

And now behold, the final creation:20170609_204614



An Enchanted Christmas Wedding


So back in 2014 my sister got married. It was a wonderful event, but I realized that I never did it justice by glorifying how beautiful it really was. So now, here I am, 3 years later, gracing everyone with pictures and memories of such a beautiful event.



On top of that, I’m showing off how gorgeous the color palette was. Seriously. It was Christmas, it was classy, it was glowing.

Color Palette

My sister tends to be more of a spring/summer kind of person, but because she got married at Christmas time, she opted for the more festive colors of Wine Red, Black, and Gold (with some champagne influence). It was a stunning combination.



They got married on December 27th, 2014 at the Boston, Massachusetts Temple. Between the building’s majestic stature, and its effervescent stained glass, it was an absolutely gorgeous venue for the ceremony.


However, it was also, like 20º, so it was freezing. I’m glad you can’t tell through our gleaming faces.


The Dress

The bride was dressed in a Maggie Sottero lace sheath gown adorned with a beaded jacket. She was an elegant vision and it really accentuated her figure.



Red Roses interspersed with Baby’s Breath. Striking!


Bridesmaids wore black knee-length dresses, with black heels, pearls, and a swath of Baby’s Breath. Now most people would shy away from black as a wedding color because of its solemnizing effect. However, far from putting a damper on the occasion, it really dressed it up, and created a stark yet stunning background for the pops of red.




NOT PICTURED: The fact that we lost the keys to the Bridal car. We spent TWO HOURS looking all over the temple grounds, in the snow, in pockets, on the sidewalk, EVERYWHERE. But to no avail. So even though we painstakingly decorated the car beautifully, the happy couple had to drive home with us in the family van. lolz. AND they had to take the family van on their honeymoon. Cheerio crumbs included.


We held the reception that evening at Hawk’s landing in Southington, Connecticut. An intimate yet elegant setting in an intimate old fashioned New England town.

Place Settings

The tables were decorated with red tablecloths, linens, cutlery, centerpieces, and kissing bells.

And in addition to the “adult” place settings, we made sure each child place setting was properly equipped with a coloring book and crayons. A must, in my opinion. You’ve got to have some way to keep the little kids entertained!


The idea behind the “Kissing Bell” is that when everyone rings them, the couple have to kiss. Cute, romantic, and got super annoying by the end.


The centerpieces consisted of 8″ vases filled with water, clear stones and floating candles. The base consisted of a mirror, stones, additional tealight candles, and silk flowers.




Besides the meal, food included a hot cocoa bar, with different mix-ins, and a bunch of Ferrero Rocher’s. Yum.

I….actually have no idea what was served for dinner. But I remember it was good.


Table Numbers


The Cake


Wedding Invitation


The Throwing of the Boquet


Uh yep, that’s me catching the bouquet…gracefully…emilysusanphotography_r_meiling_143

aaaand dropping it.emilysusanphotography_r_meiling_144

Grace and class, people. Grace and class.

Cute Kids


This little niece got a special pink dress for the wedding day that she referred to as her “princess dress.” She was so excited to wear it, that we’re pretty sure she thought the reception was for her.emilysusanphotography_r_meiling_96

This is her not understanding why the bride has a prettier dress than her.emilysusanphotography_r_meiling_116emilysusanphotography_r_meiling_211

Absolutely precious.

Oh yeah, and the couple is pretty cute too.




Getting JSP to connect to a MySQL database


In this tutorial, we will demonstrate how to connect to a MySQL database using JSP, an extremely useful resource in server side technologies We are going to assume in this tutorial that you already have a database created that you wish to connect to. JSP stands for JavaServer Pages and can used to create dynamically created web pages using the Java programming language. Like php, JSP is a server-side language, and because it is a server-side language, like, php, it requires a server to run. While PHP often uses an Apache server, and Node.JS often creates its own server, JSP usually requires a server with a servlet container, such as Tomcat or Jetty. JSP is a powerful tool because you can execute java code right within the same jsp file that is generating the html, and it executes quickly. Connecting to a database in JSP is easy and fast, resulting in a better user experience. In this tutorial, we will learn how to set up your development environment, and use that to connect to the MySQL database for performing queries. By the end of this tutorial, you will be well on your way to becoming a JSP developer!

Preparing your environment

In order for JSP to run, you need a server. For our purposes, we will be using Tomcat on a Linux machine. In order to run Tomcat, you need to install the server, and make sure you have JDK installed. What is JDK you might ask? JDK stands for Java Development Kit. Essentially, this package allows you to code in the Java programming language. Install Tomcat on your Linux machine by executing the following commands in a terminal:

sudo apt-get update sudo apt-get install tomcat6 sudo apt-get install tomcat6-admin sudo apt-get install tomcat6-user

These commands tell your Linux machine to update, to install the tomcat server, and to install the roles of “admin” and “user,” which we will address later in this tutorial. Next, check to make sure you have the most updated openjdk

sudo apt-get update sudo apt-ge install openjdk-6-jdk

In order for Tomcat to be able to run the JDK, Tombcat needs to be told where the JDK is. For this, edit the Tomcat configuration file by using the vim editorsudo vim /etc/default/tomcat6. Each machine’s file organization is different, of course, but for my machine, I uncommented the following line:


And changed it to


You are also going to need to edit your Tomcat policy file to allow connections from Tomcat to your MySQL database by adding the following lines to the end of the policy file:

grant { permission java.net.AllPermission; permission java.net.SocketPermission "localhost:3306", "connect"; permission java.net.SocketPermission "(your live server address here):3306", "connect"; };

One final thing, for the server to work, you also have to download a .tar file that will provide the connector for your JSP. You can find the download file HERE. Once downloaded, copy the file into the directory /usr/share/tomcat6/lib/ At this point, you may restart your newly installed Tomcat server (sudo /etc/init.d/tomcat6 restart) and check to see that your server is working by opening a browser and visiting localhost:8080. If all goes well, you should see the following on your browser:Screenshot from 2015-04-08 09_52_01

Creating a JSP page

Congratulations, you have successfully configured an environment for programming in JSP! Now , the times comes to create your first jsp page. It’s as simple as creating a generic html page, but first we must establish the correct permissions on our Tomcat server so that we can write files to it.

sudo chown [username] /var/lib/tomcat6/webapps/ROOT -R sudo chmod 775 /var/lib/tomcat6/webapps/ROOT -R

Restart Tomcat, open up a text editor and we are ready to get started! In the text editor, create a basic html page. After all, JSP is simply a page that combines html and java code that is executed by the server. The html we shall use is as follows:

<!doctype html> <head> <title>Our First JSP!</title> </head> <body> <h1>Hello World! This is our first JSP!</h1> </body> </html>

This should output the following: html hello world Now that we have the basic skeleton for our html page, we can begin the magic by adding in snippets of Java code. This is what differentiates JSP from other client-side technologies like JavaScript, which executes only in the browser. With JSP, all the code can be executed in Java on the server before displaying to the user’s browser. Like Node.JS, Java code is distinguished from the surrounding html by <% %> brackets. Inside these magical brackets, you may implement all the Java your heart desires. For demonstration purposes, let us execute some Java code in our html page.

<% String hello = "Hello World! JSP is my favorite!"; out.println(hello); %>

You’re going to want to put this code somewhere within the html <body></body>tags. At this point we have a functioning JSP, so let’s connect to the database!


First, a refresher on MySQL basics. MySQL Relational Database Managements System. It communicates to the database using SQL, which stands for Structured Query Language. Essentially, you submit a command to your database using a SQL statement, and it executes on your database. With SQL, you can read from your database, create entries, update them, and delete them. SQL can be used in virtually any programming language or framework to access a database. MySQL is just one of many RDBMS’s out there. Others include Oracle, Microsoft SQL Server, IBM DB2, SAP, and others.

Connect to the Database

In order to connect a database in JSP, you have to include the right libraries and use the correct drivers. Insert the following code snippet at the top of your JSP page (before any of the html stuff):

<%@ page import = "java.sql.*" %>
 <%@ page import = "java.sqlx.*" %>
 <% Class.forName("com.mysql.jdbc.Driver"); java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://databaseaddress, username,password); %>

Let me explain the above code. In order to connect to a MySQL Database in any language, you first need to import the sql libraries using the first two lines of code above. You also need a database connection. In order to create a database connection in MySQL, you need what is called jdbc (Java Database Connector). You import this connector into your code by declaring a Java Class. By using Class.forName() you are able to import the entire class within your code. As a parameter for this Class.forName(), you are calling “com.mysql.jdbc.Driver”. All this represents is the address for the java database connector Driver. At this point, you need to make the actual connection to your specific database using your individual information. conn represents the variable in which you will store your database connection information. The variable type isn’t a regular String or int, but rather it is a java.sql.Connection. While at first intimidating, all this type expression is, is a type of variable that was created in the “com.mysql.jdbc.Driver” class we imported into our code. It is saying that within the “com.mysql.jdbc.Driver” Class, we are using a Connection object, which is within “sql”, which is also within “java”. This connection object will let us connect to our database by inputting all the sensitive information. Now we assign something to the object conn. We are assigning a method to it that was imported from the “com.mysql.jdbc.Driver” Class. The method we are using is DriverManager.getConnection(). Inside the parentheses, we shall input our credentials for our MySQL database. The first parameter you put is the address of your MySQL database. If your database is on the server you are working on, then you can simply put a file path there. However, since our JSP page is on our local machine, and our MySQL database is on a live server, he have to put the entire URL. The address for my database is:

"jdbc:mysql://" is the IP address of the server where my MySQL database is located. :3306 is the port number. 3306 is the port most often used for the MySQL Database system. Then you input your username in quotes like so: “johnsample”. Then finally, your password: “securepassword”. Make sure each of the parameters are separated by commas, and you should be good to go.

Doing something with the Database

This should be all that is necessary to create a connection to the database. But now what? How do you know it’s even working? Well, one way to test it is to execute a statement and see if it goes through. Let’s try to print out some rows of a table onto our JSP page Within the <body></body>tags, we will insert a scriptlet (use these brackets <% %>). Then, insert the following code onto your page:

// Store query in a String variable
 String query = "SELECT userId, userName FROM users";
 // Create the java statement Statement stmt = conn.createStatement();
 // Execute the query, and get a java resultset
 ResultSet rslt = stmt.executeQuery(query);
 //iterate through the java resultset
 while (rslt.next())
 String userId = rslt.getString("userId");
 String userName = rslt.getString("userName");
 // Print the results
 String html = "<p>" + userId + ", " + userName + "</p>";

Now let’s explain what all the gobbledeguck is about. First, you create a SQL statement, which we are storing in a string called query. Next we create a Java statement. Java statements are how to properly prepare query statements in Java. We are storing our statement in a variable called stmt. Next, we can execute the MySQL query using the executeQuery() method. We use the executeQuery() method on the statement object stmt, and store it into a resultset variable called rslt. At this point, the query has been executed and we have all the results stored in an accessible variable. Now the only thing that remains is to actually output the data onto the page.

To print the table data onto the page, we must loop through the rows of the table and store the data into variables. We write a while loop that iterates through the result set. Within the while loop, we store the userId into a String variable called userId, and we store the userName into a String variable called userName, using the getString method on the rslt object. We output the variables within <p></p> tags using the java out.println method.

At this point, you should be able to to view the user id’s and usernames of the rows in your MySQL table on your webpage:

mysql output

Congratulations! You have connected to a MySQL database using JSP!!

Still not working?

If you’ve had trouble connecting to the database, check the following things in your system:

  • Have you restarted your tomcat server?
  • Do ALL of your files have correct permissions?(775, make sure that you are the owner)
  • Do you have syntax errors? Check your capitalization and semicolons
  • Is your SQL statement valid? You can check if your SQL statement will prepare and execute by using the SQL feature of phpmyadmin and testing your statement there.
  • If your page printed out an error message, READ IT. It will probably help you troubleshoot the problem.

Additional Resources

The following are good resources for further learning and trying to connect to the database. I, myself, used many of these links when connecting with JSP for the first time. Enjoy!

  • Connecting JSP To Mysql Database Lesson: This link provides a good step-by-step tutorial on how to connect using excellent graphics to demonstrate the architecture of connecting to a database.
  • JSP – Database Access: This tutorial is helpful if you do not have a database created, because it takes you step-by-step through the process of creating a database a table.
  • MySQL JSP Database Connect Demo: This website provides a full demo of a database connection with MySQL, and though some of the syntax is different, accomplishes the same tasks using the same principles.
  • Stack Overflow question troubleshooting a MySQL database connection: This link illustrates the importance of the MySQL driver in JSP, because this user did not import his library correctly. If you are having problems with your Driver, check out this link.