javaScript connect to database
Key words: js connected database, javascript connection database, js operation database, js read a database, javascript link data
Database on the Desktop
<script language="javascript">
/ / Use javascript to write server-side sample code to connect database
function conn () (
var db_bbs
db_bbs = "dd.mdb" / / definition of a database
var conn = new ActiveXObject ( "ADODB.Connection");
conn.Open ( "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =" + db_bbs +"");
var rs = new ActiveXObject ( "ADODB.Recordset");
var sql = "select name from authors"; / / database in the authors table, name field
rs.open (sql, conn);
alert (rs (0)) / / Remove the first to
conn.close ();
conn = null;
)
</ script>
The following is the sql connection
<script language="javascript">
/ / Use javascript to write server-side sample code to connect database
var conn = new ActiveXObject ( "ADODB.Connection");
conn.Open ( "Provider = SQLOLEDB.1; Data Source = localhost; User"
+ "Password =; Initial Catalog = pubs");
var rs = new ActiveXObject ( "ADODB.Recordset");
var sql = "select * from authors";
rs.open (sql, conn);
rs.close ();
rs = null;
conn.close ();
conn = null;
</ script>
Related Posts of javaScript connect to database
-
hibernate using c3p0 connection pooling
Private http://www.lifevv.com/tenyo/doc/20070605102040991.html c3p0 for open source's JDBC connection pool, with the release hibernate. This article describes how to use the hibernate configuration in c3p0. c3p0 connection pool configuration is v ...
-
Hibernate configuration parameters hibernate.hbm2ddl.auto
Hibernate in the configuration file: <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...
-
Build flex + spring + blazeds + hibernate application
Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis ...
-
Hibernate connection pool configuration
Hibernate connection pool configuration <! - Jdbc -> <property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property> <property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.1 ...
-
In the servlet use Bean
According to Sun's definition, JavaBean is a reusable software components. In fact JavaBean is a Java class, through the package into a property and methods of treatment of a function or a business object, referred to as bean. Because JavaBean is ...
-
The EJB3 Persistence
EJB3 persistence with Hibernate is very similar to the mechanism: Environment: Server: JBOSS5.0 Database: MySQL5.0 1. Set up a data source First of all, in jboss-5.0.0.GA \ server \ default \ deploy, the establishment of a database used to connect the dat
-
hibernate generic generic DAO
hibernate generic generic DAO
-
Struts2 + hibernate + spring problem user log in
dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q
-
Hibernate secondary cache
Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...
-
Hibernate's lazy strategy
hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...













Leave a Reply