{"id":16824,"date":"2013-09-07T15:00:26","date_gmt":"2013-09-07T12:00:26","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=16824"},"modified":"2014-11-08T14:19:13","modified_gmt":"2014-11-08T12:19:13","slug":"java-stored-procedures-in-java-db","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html","title":{"rendered":"Java Stored Procedures in Java DB"},"content":{"rendered":"<h2>1 Java Stored Procedure<\/h2>\n<p>This post is about Java stored procedures in Java DB.<\/p>\n<p>Java DB is a relational database management system that is based on the Java programming language and SQL. This is the Oracle release of the Apache Software Foundation&#8217;s open source Derby project. Java DB is included in the Java SE 7 SDK.<\/p>\n<p>Java code invoked within the database is a stored procedure (or procedure). Java stored procedures are database side JDBC (Java Database Connectivity) routines.<\/p>\n<p>The procedure code is defined in a Java class method and stored in the database. This is executed using SQL. The procedure code can be with or without any database related code.<\/p>\n<p>Other database side (or server side) programs are triggers and table functions.<\/p>\n<h3>1.1 Java Procedure Types<\/h4>\n<p>There are two types of stored procedures, based on the transaction in which they are invoked in: nested connections and non-nested connections.<\/p>\n<h4>Nested Connections<\/h4>\n<p>This type of procedure uses the same transaction as that of the SQL statement that called it. The procedure code uses the same connection as that of the parent SQL, using the connection URL syntax <code>jdbc:default:connection<\/code>. The following is an example code bit to get a connection:<\/p>\n<pre class=\"brush:java\">Connection c = DriverManager.getConnection(\"jdbc:default:connection\");<\/pre>\n<p>Note that the connection URL attributes are not supported for this type.<\/p>\n<p>Example code at: <em>2.1 Creating<\/em>.<\/p>\n<h4>Non-nested Connections<\/h4>\n<p>This type of procedure uses a new database connection. The procedure is executed in a different transaction than that of the calling SQL.<\/p>\n<p>The stored procedure code can also connect to a different database.<\/p>\n<p>Example code at: <em>3.1 Using a Non-nested Connection<\/em>.<\/p>\n<h3>1.2 SQL Exceptions in Procedures<\/h3>\n<p>SQL exceptions in procedures can be caught and handled within the procedure code, or propagated (and caught) in the calling program.<\/p>\n<h2>2 Create and Use a Java Stored Procedure<\/h2>\n<p>This describes the creating a Java stored procedure in Java DB database and using it interactively in SQL as also in Java code. The stored procedure code is created using the Java programming language. The procedure is Java code in a method with signature <code>public static void procedureMethod<\/code>. The stored procedure is created and stored in the Java DB database as a database object.<\/p>\n<p>The procedure is invoked (or called) using a SQL command, or from a Java program using JDBC API.<\/p>\n<h3>2.1 Creating<\/h3>\n<p>Create a Java method, compile it, and store the procedure in database.<\/p>\n<h4>2.1.1 Create a Java Method<\/h4>\n<p>The following is an example method.<\/p>\n<pre class=\"brush:java\">public static void testProc(int iParam1, String iParam2, int [] oParam)\r\n        throws SQLException {\r\n    String connectionURL = \"jdbc:default:connection\";\r\n    Connection conn = DriverManager.getConnection(connectionURL);\r\n    String DML = \"UPDATE TEST_TABLE SET NAME = ? WHERE ID = ?\";\r\n    PreparedStatement pstmnt = conn.prepareStatement(DML);\r\n    pstmnt.setString(1, iParam2);\r\n    pstmnt.setInt(2, iParam1);\r\n    int updateRowcount = pstmnt.executeUpdate();\r\n    oParam [0] = updateRowcount;\r\n} \/\/ testProc()\r\n<\/pre>\n<p>The code is created in a Java class, for example <code>JavaStoredProcs.java<\/code>, and compiled. Any number of procedure methods can be created within a class.<\/p>\n<p>In the example code:<\/p>\n<ul>\n<li>The procedure method has three parameters. The first two (iParam1 and iParam2) are of IN and the third is an OUT parameter modes respectively. Note that the OUT parameter is specified as an array; each OUT and INOUT parameter is required to be specified in the procedure method as an array, and only the first element of the array is used (i.e., mapped) as the procedure parameter variable.<\/li>\n<li>The procedure uses a nested connection.<\/li>\n<li>Any SQL exception thrown can be handled in the calling program, or within the procedure method; in this case the exception is handled in the calling code.<\/li>\n<\/ul>\n<h4>2.1.2 Create a Procedure in Database<\/h4>\n<p>The procedure is created in the database using the CREATE PROCEDURE statement. This command is run interactively using <code>ij<\/code>, or from a Java program using JDBC API\u2019s <code>java.sql.Statement<\/code> interface.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>The command syntax and details is as follows:<\/p>\n<pre class=\"brush:sql\">CREATE PROCEDURE procedure-Name(ProcedureParameters)ProcedureElements<\/pre>\n<p><strong><code>procedure-Name<\/code>:<\/strong> is the procedure name as stored in the database; is created in the default schema, if not specified.<\/p>\n<p><strong><code>ProcedureParameters<\/code>:<\/strong> specifies the parameter mode (IN, INOUT or OUT), an optional name and the data type. The data type is of the database data type. Java DB does not support long column types (for example Long Varchar, BLOB, \u2026) in procedures. Parameters are optional.<\/p>\n<p><strong><code>ProcedureElements:<\/code><\/strong> This must contain the following three elements, and can have additional optional ones.<\/p>\n<ul>\n<li>LANGUAGE JAVA. This is the only value.<\/li>\n<li>PARAMETER STYLE JAVA. This is the only value.<\/li>\n<li>EXTERNAL NAME. This specifies the Java method to be called when the procedure is executed, and takes the form <code>ClassName.methodName Optional, procedure elements<\/code>:<\/li>\n<ul>\n<li>DYNAMIC RESULT SETS integer<\/li>\n<li>DeterministicCharacteristic<\/li>\n<li>EXTERNAL SECURITY<\/li>\n<li>MODIFIES SQL DATA (the default), CONTAINS SQL, READS SQL DATA, NO SQL (a procedure without any database related code)<\/li>\n<\/ul>\n<\/ul>\n<h4>2.1.2.1 Create Procedure in Database Interactively Using <code>ij<\/code><\/h4>\n<p><code>ij<\/code> is a command line tool included with Java DB. <code>ij<\/code> is a JDBC tool used to run interactive queries on a Java DB database.<\/p>\n<pre class=\"brush:bash\">ij&gt; CONNECT 'jdbc:derby:testDB';\r\nij&gt; CREATE PROCEDURE PROC_NAME(IN id1 INTEGER, IN name2 VARCHAR(50), OUT count3 INTEGER) LANGUAGE JAVA EXTERNAL NAME 'JavaStoredProcs.testProc' PARAMETER STYLE JAVA;\r\n<\/pre>\n<p>In the example, the procedure <code>PROC_NAME<\/code> is created in the <code>testDB<\/code> database. The Java method created earlier (<em>2.1.1 Create a Java Method<\/em>), is specified as the EXTERNAL NAME.<\/p>\n<p>To list the procedures in the database, use the command SHOW PROCEDURES.<\/p>\n<h4>2.2.2 Change or Delete a Procedure<\/h4>\n<p>To change a procedure, delete the procedure from the database and create again.<\/p>\n<p>Example for deleting a procedure using <code>ij<\/code>:<\/p>\n<pre class=\"brush:bash\">ij&gt; DROP PROCEDURE procedureName;<\/pre>\n<h3>2.2 Using (Invoking)<\/h3>\n<p>A procedure is run interactively using the SQL CALL command or from a client program using JDBC API.<\/p>\n<p>The CALL SQL command supports only IN parameters. The JDBC API\u2019s <code>CallableStatement<\/code> interface is used to invoke a procedure with IN, INOUT or OUT parameters.<\/p>\n<h4>2.2.1 CALL SQL Statement<\/h4>\n<p>The CALL statement is used to invoke a procedure. This does not return a value. Only procedures with IN parameters are supported when invoked using the CALL.<\/p>\n<p>The following example shows a CALL command run from ij to invoke the procedure <code>MyProc. MyProc<\/code> is the name of a procedure as defined in the database using CREATE PROCEDURE.<\/p>\n<pre class=\"brush:bash\">ij&gt; CALL MyProc();<\/pre>\n<h4>2.2.2 Invoke Procedure from a Java Program<\/h4>\n<p>This example code invokes the procedure (PROC_NAME) created earlier (2.1 Creating).<\/p>\n<p>The code uses JDBC API\u2019s <code>CallableStatement<\/code> interface (more details at <em>2.2.3 Notes on CallableStatement<\/em>). The input parameters to the procedure are set and the out parameter value is printed at the end of this example method. Note that this Java class is different than that of the class in which the procedure is created.<\/p>\n<pre class=\"brush:java\">private static void runStoredProc(Connection conn)\r\n        throws SQLException {\r\n    int iParam1 = 1;\r\n    String iParam2 = \"updated name data\";\r\n    String proc = \"{call PROC_NAME(?, ?, ?)}\";\r\n    CallableStatement cs = conn.prepareCall(proc);\r\n    cs.setInt(1, iParam1);\r\n    cs.setString(2, iParam2);\r\n    cs.registerOutParameter(3, java.sql.Types.INTEGER);\r\n    cs.executeUpdate();\r\n    String oParam = cs.getInt(3);\r\n    System.out.println(\"Updated row count from the proc: \" + oParam);\r\n} \/\/ runStoredProc()\r\n<\/pre>\n<h4>2.2.3 Notes on CallableStatement<\/h4>\n<p>Java JDBC API\u2019s <code>CallableStatement<\/code> interface extends <code>PreparedStatement<\/code> and is defined in <code>java.sql<\/code> package. This is used to execute SQL stored procedures.<\/p>\n<p>The API provides a stored procedure SQL escape syntax that allows procedures to be called in a standard way for all RDBMSs. Syntax has one form that includes a result parameter and one that does not. If used, the result parameter must be registered as an OUT parameter. The other parameters (arg1, arg2, &#8230;) can be used for input, output or both.<\/p>\n<p>The following are the syntax (with and without return value, respectively):<\/p>\n<pre class=\"brush:bash\">{? = call &lt;procedure-name&gt; [(arg1, arg2, ...)]}\r\n{call &lt;procedure-name&gt; [(arg1, arg2, ...)]}\r\n<\/pre>\n<p>IN parameter values are set using the setter methods inherited from the <code>PreparedStatement<\/code>. The type of all OUT parameters must be\u00a0 registered prior to executing the stored procedure using registerOutParameter(); their values are retrieved after execution, via the getXxx(int parameterIndex \/ StringparameterName) methods (getBoolean(), getArray(),\u00a0 &#8230;).<\/p>\n<h4>Parameter Modes<\/h4>\n<p>The parameter attributes IN (the default), OUT, and INOUT are parameter modes.<\/p>\n<h4>Calling a Stored Procedure<\/h4>\n<pre class=\"brush:java\">String procName = \"{call STORED_PRODURE_NAME(}\";\r\nCallableStatement cs = conn.prepareCall(procName);\r\nResultSet rs = cs.executeQuery();\r\n<\/pre>\n<p>To call a stored procedure, use execute(), executeQuery(), or executeUpdate() methods depending on how many <code>ResultSet<\/code> objects\u00a0 the procedure returns. If not sure how many <code>ResultSet<\/code> objects the procedure returns, use the execute() method.<\/p>\n<pre class=\"brush:java\">cs = conn.prepareCall(\"{call INCR_PRICE(?, ?)}\");\r\ncs.setString(1, itemNameArg);\t\t\t\t\/\/ (1)\r\ncs.setFloat(2, newPriceArg);\t\t\t\t\/\/ (2a)\r\ncs.registerOutParameter(2, Types.NUMERIC); \t\/\/ (2b)\r\ncs.execute();\r\nfloat newPrice = cs.getFloat(2);\t\t\t\/\/ (2c)\r\n<\/pre>\n<p>The first parameter <em>1<\/em> is an IN parameter.<\/p>\n<p>The second parameter has the parameter mode INOUT. It\u2019s IN value is specified by calling the setter method <em>2a<\/em> and register the OUT type with the registerOutParameter() method <em>2b<\/em>. The output value is retrieved by the getter method <em>2c<\/em>.<\/p>\n<h2>3 Examples<\/h2>\n<p>There are two examples: the first shows code to create and use a non-nested type procedure, and the next is an example usage of a Java DB\u2019s pre-defined procedure.<\/p>\n<h4>3.1 Using a Non-nested Connection<\/h4>\n<p>In this example, the Java procedure accesses a different database and connection, than the one used in the calling program. The procedure returns an OUT integer parameter value.<\/p>\n<ul>\n<li>Create and compile the procedure code.\n<pre class=\"brush:java\">public static void testProc4(int [] retval)\r\n        throws SQLException {\r\n    String connectionURL = \"jdbc:derby:testDB2\";\r\n    Connection conn = DriverManager.getConnection(connectionURL);\r\n    Statement stmt = conn.createStatement();\r\n    ResultSet rs = stmt.executeQuery(\"SELECT * FROM ID_TABLE\");\r\n    int nextid = 0;\r\n    while(rs.next()) {\r\n        nextid = rs.getInt(\"ID\");\r\n    }\r\n    retval[0] = nextid;\r\n    conn.close(); \/\/ alternative: shutdown the database.\r\n} \/\/ testProc4()\r\n<\/pre>\n<\/li>\n<li>Create the procedure in the database.\n<pre class=\"brush:sql\">CREATE PROCEDURE PROC_NAME_4(OUT paramname INTEGER)\r\n    LANGUAGE JAVA\r\n    EXTERNAL NAME 'JavaStoredProcs.testProc4'\r\n    PARAMETER STYLE JAVA\r\n    READS SQL DATA;\r\n<\/pre>\n<p>The procedure element READS SQL DATA specifies that the SQL in procedure method can only use SELECT statements.<\/li>\n<li>Invoke the procedure in client program.\n<pre class=\"brush:java\">private static void runStoredProc4(Connection conn)\r\n        throws SQLException {\r\n    String proc = \"{call PROC_NAME_4(?)}\";\r\n    CallableStatement cs = conn.prepareCall(proc);\r\n    cs.registerOutParameter(1, java.sql.Types.INTEGER);\r\n    cs.execute();\r\n    int oParamData = cs.getInt(1); \/\/ proc output value\r\n} \/\/ runStoredProc4()\r\n<\/pre>\n<\/li>\n<\/ul>\n<h4>3.2 A Java DB Built-in System Procedure<\/h4>\n<p>SYSCS_UTIL.SYSCS_BACKUP_DATABASE is a pre-defined and Java DB specific system procedure. This backs up the database to a specified directory. The syntax is SYSCS_BACKUP_DATABASE(IN backupDirPath VARCHAR). The procedure does not return a value.<\/p>\n<p>The following example SQL command invokes the procedure:<\/p>\n<pre class=\"brush:bash\">CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE('c:\/backupdir');<\/pre>\n<p><strong>Note:<\/strong> A detailed example Java code can be found in the blog post titled <em>Backing up a Java DB Database<\/em> at <a href=\"http:\/\/www.javaquizplayer.com\/blogposts\/blogpost4.html\">http:\/\/www.javaquizplayer.com\/blogposts\/blogpost4.html<\/a><\/p>\n<h2>4 NOTES<\/h2>\n<h4>4.1 Some Advantages of Procedures over Client Code<\/h4>\n<ul>\n<li>The routine allows the code to be stored once on the database server and can be accessed from multiple applications. Also, the code can be complex as compared to that of SQL.<\/li>\n<li>The code is executed on the server hence there is reduced network traffic in aclient-server application. This improves an application\u2019s performance.<\/li>\n<\/ul>\n<h4>4.2 Other RDBMSs<\/h4>\n<p>Oracle\u2019s 10g and HyperSQL DataBase (HSQLDB) are some of the other databases that support Java stored procedures.<\/p>\n<h2>5 References<\/h2>\n<ul>\n<li><a href=\"http:\/\/db.apache.org\/derby\/manuals\/index.html\">Apache Derby &gt; Documentation (10.8 Manuals)<\/a><\/li>\n<li><a href=\"http:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/sql\/package-summary.html\">Java SE 7 API &gt; java.sql package<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1 Java Stored Procedure This post is about Java stored procedures in Java DB. Java DB is a relational database management system that is based on the Java programming language and SQL. This is the Oracle release of the Apache Software Foundation&#8217;s open source Derby project. Java DB is included in the Java SE 7 &hellip;<\/p>\n","protected":false},"author":469,"featured_media":148,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-16824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java Stored Procedures in Java DB<\/title>\n<meta name=\"description\" content=\"1 Java Stored Procedure This post is about Java stored procedures in Java DB. Java DB is a relational database management system that is based on the Java\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Stored Procedures in Java DB\" \/>\n<meta property=\"og:description\" content=\"1 Java Stored Procedure This post is about Java stored procedures in Java DB. Java DB is a relational database management system that is based on the Java\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-07T12:00:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-08T12:19:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Prasad Saya\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasad Saya\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html\"},\"author\":{\"name\":\"Prasad Saya\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/4e6049281bfacae69c80f3ccb386a6c1\"},\"headline\":\"Java Stored Procedures in Java DB\",\"datePublished\":\"2013-09-07T12:00:26+00:00\",\"dateModified\":\"2014-11-08T12:19:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html\"},\"wordCount\":1469,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"articleSection\":[\"Core Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html\",\"name\":\"Java Stored Procedures in Java DB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"datePublished\":\"2013-09-07T12:00:26+00:00\",\"dateModified\":\"2014-11-08T12:19:13+00:00\",\"description\":\"1 Java Stored Procedure This post is about Java stored procedures in Java DB. Java DB is a relational database management system that is based on the Java\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/java-stored-procedures-in-java-db.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/core-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java Stored Procedures in Java DB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/4e6049281bfacae69c80f3ccb386a6c1\",\"name\":\"Prasad Saya\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e609b016db1df8cd1e5630c7f79639882ed27a278ffc06dd98f4534dfe173575?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e609b016db1df8cd1e5630c7f79639882ed27a278ffc06dd98f4534dfe173575?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e609b016db1df8cd1e5630c7f79639882ed27a278ffc06dd98f4534dfe173575?s=96&d=mm&r=g\",\"caption\":\"Prasad Saya\"},\"description\":\"Prasad Saya is a software engineer with over ten years\u2019 experience in application development, maintenance, testing and consulting on various platforms. He is also a certified Java and Java EE developer. At present his interest is in developing Java applications.\",\"sameAs\":[\"http:\\\/\\\/www.javaquizplayer.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/prasad-saya\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Stored Procedures in Java DB","description":"1 Java Stored Procedure This post is about Java stored procedures in Java DB. Java DB is a relational database management system that is based on the Java","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html","og_locale":"en_US","og_type":"article","og_title":"Java Stored Procedures in Java DB","og_description":"1 Java Stored Procedure This post is about Java stored procedures in Java DB. Java DB is a relational database management system that is based on the Java","og_url":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-09-07T12:00:26+00:00","article_modified_time":"2014-11-08T12:19:13+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","type":"image\/jpeg"}],"author":"Prasad Saya","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Prasad Saya","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html"},"author":{"name":"Prasad Saya","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/4e6049281bfacae69c80f3ccb386a6c1"},"headline":"Java Stored Procedures in Java DB","datePublished":"2013-09-07T12:00:26+00:00","dateModified":"2014-11-08T12:19:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html"},"wordCount":1469,"commentCount":6,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","articleSection":["Core Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html","url":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html","name":"Java Stored Procedures in Java DB","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","datePublished":"2013-09-07T12:00:26+00:00","dateModified":"2014-11-08T12:19:13+00:00","description":"1 Java Stored Procedure This post is about Java stored procedures in Java DB. Java DB is a relational database management system that is based on the Java","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/java-stored-procedures-in-java-db.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/core-java"},{"@type":"ListItem","position":4,"name":"Java Stored Procedures in Java DB"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/4e6049281bfacae69c80f3ccb386a6c1","name":"Prasad Saya","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e609b016db1df8cd1e5630c7f79639882ed27a278ffc06dd98f4534dfe173575?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e609b016db1df8cd1e5630c7f79639882ed27a278ffc06dd98f4534dfe173575?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e609b016db1df8cd1e5630c7f79639882ed27a278ffc06dd98f4534dfe173575?s=96&d=mm&r=g","caption":"Prasad Saya"},"description":"Prasad Saya is a software engineer with over ten years\u2019 experience in application development, maintenance, testing and consulting on various platforms. He is also a certified Java and Java EE developer. At present his interest is in developing Java applications.","sameAs":["http:\/\/www.javaquizplayer.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/prasad-saya"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/16824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/469"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=16824"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/16824\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/148"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=16824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=16824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=16824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}