SP Operations Access databaseRecently in the use of JSP to write the company's Web site sample program, used in the JSP operation Access database, a lot of things are not difficult, but we do not know. ^-^ hehe, so now I wrote a small program, to
Oracle/*
drop table varray_table;
Drop type Num_varray;
CREATE TYPE Num_varray as Varray of VARCHAR2 (12)
/
CREATE TABLE varray_table (col1 num_varray);
INSERT into Varray_table VALUES (num_varray (' Hello ', ' abc '));
SELECT * from Varray_table;
When using JDBC to connect to a database, we use ExecuteQuery (String sql) to get a result set. We need to iterate over the resultset result set according to different data structures when the database structure changes or when we get other database
Data | database | database connection
(Excerpt from Java Chinese station)
This article is the author in the configuration of the blog of Brother Liao used, just started using Tomcat5.0.27, and then use Tomcat5.5.4, but the configuration database
I made a simple packaging class, the source code posted for your reference. This program is not rigorously tested and needs further refinement, and the code is tested through the xlc of Vs2005 and Aix.
Note: If you need to link in vs2005, you will
JS Building Dynamic Web site with JSP Sun-yi Cuckoo
First, what is JSP JSP (JavaServer Pages) is initiated by the Sun Microsystems Company, a number of companies involved in the establishment of a dynamic Web page technology standards, its Web site
One feature of the Java programming language is storage automation, which frees programmers from the error-prone process of releasing used memory. However, many programs still have to deal with resource issues, such as file and database connections,
Oracle
Java Web Development environment layout has always been very cumbersome, but also remember to do the undergraduate graduation design configuration JBUILDER2005+WEBLOGIC8.1+SQL2K integration environment, the painful experience, recently
Starting with MySQL 5.0, a new SQL syntax is supported:
PREPARE stmt_name FROM preparable_stmt; EXECUTE stmt_name [USING @var_name [, @var_name] ...]; {DEALLOCATE | DROP} PREPARE stmt_name;
Through it, we can implement a dynamic SQL statement like
Js|mysql
Premise:
Place the MySQL database driver in the Web-inf\lib directory of the working directory (so you can link to the JSP)
With a JavaBean connection, the compiled. class file is placed under the classes file, and if the file contains
Data | Data source JSP development call Tomcat database connection pool, perhaps a lot of friends will, the following code is believed to have used people are familiar with:
list1:testpool.jsp
InitialContext ctx=new InitialContext ();DataSource ds =
1, the installation of MySQL diagram.
2, the difference between different databases on the impact of the program
1) Data type
2) Paging problem
SQL paging is fairly simple, and the paging is different for different databases. SQL Server is also
js| Data | Database Four, JSP connection Informix database
testinformix.jsp is as follows:
String url =
"Jdbc:informix-sqli://123.45.67.89:1533/testdb:informixserver=myserver;
User=testuser;password=testpassword ";
//testdb for your
JS Appendix: JDBC TM Technology Analysis
1. Definition of JDBCTM
JDBCTM is a JAVATM API for executing SQL statements, which consists of a set of classes and interfaces written in the Java programming language. JDBC provides tools/database
You can use the 10046 event to track
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 The
startup mount oracle instance started. total system global area 835104768 bytes fixed size 2257840 variable
Data | Database A stmt can bind only one result set at a time, if you want to set up multiple result sets, you have to build multiple stmt. If you define stmt in a bean, it involves a technical issue of development, and you can use the following
When you are faced with a JSP connection MySQL database problem, you first need to create a username table in the MySQL database, the table inside the creation of two character fields, field names are: Uid,pwd, and then insert a few test data.
The
Connecting databases | Several ways and examples of connecting databases in Project Java projects
1, the most original writing (also the general beginners to the wording)
First import the database connection base class, then the others are then
js| package source Author: Herd
1. Create a Bean
Package guestbook;
Import java.sql.*;
/**
* Title: Connect the database with JavaBean
* Description: Encapsulates the commonly used database functionality in a bean and declares the bean in a JSP.
Problem Description:
If the data entered by the user is inserted into an SQL query without processing, the application is likely to suffer a SQL injection attack, as in the following example:
The code is as follows
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