Lanp:gintlanp能拼写出什么单词 时间:2022-10-12 18:50:47 由作文陶老师原创 分享 复制全文 下载本文 作文陶老师原创2022-10-12 18:50:47 复制全文 下载全文 目录1.gintlanp能拼写出什么单词2.lanp的意思是?3.继电器的corn lanp是什么意思4.spring-ibatis怎样通过点击button向数据库添加数据csdn5.linux使用什么命令查看端口 ?6.linux使用什么命令查看端口7.liunx怎么看mongodb已经启动成功1.gintlanp能拼写出什么单词plant的现在分词,plant还有植物的意思,做这个意思时,不能加ing/ed等。2.lanp的意思是?lamp lamp[læmp;læspirit lampthe Lady of [with] the L~持灯的妇人(南丁格尔 (F. Nightingale) 的别称;因夜晚持灯巡视医院而得名)b. (医疗用等的) 电灯;灯火an infrared ~红外线灯→ sunlamp2 (心、知识等的) 光明;3.继电器的corn lanp是什么意思将以下jar包加入到工程,commons-logging-1.0.4.jar、ibatis-2.3.0.677.jar、mysql-connector-java-5.0.3-bin.jar、spring.jar。2. 在MySQL中创建数据库和相应的表:Drop TABLE IF EXISTS `MYDB`.`student`;insert into student values(",ph"true),wxh"true);3. 创建实体Bean;package com.lanp.beans;/,public class Student implements Serializable { private static final long serialVersionUID = -7163004163334815825L?public String getName() { return name:} } 4. 创建Student实体Bean与数据库映射的SQLMap文件;student.xml;xml version="encoding=",UTF-8":>?ibatis.apache.org/DTD SQL Map 2.0/?EN""!http;//ibatis.apache.org/dtd/sql-map-2.dtd">sqlMap>-- 为Person类设置一个别名 --><typeAlias alias="student":type="com.lanp.beans.Student"/><-!- 配置表和实体Bean之间的映射关系 -->class="psw"result property="column="enabled"insertStudent"student"#enabled#),]]>string"[CDATA[ SELECT * FROM STUDENT WHERE NAME=#name# ]]>/!studentMap"><!/5. 创建访问数据库的DAO接口;StudentDao.java;} 6. 创建访问数据库的DAO接口实现类:StudentDaoImpl.java?package com.lanp.dao;import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;public class StudentDaoImpl extends SqlMapClientDaoSupport implements StudentDao { @Override public Student getStudent(String name) { try{ return (Student)getSqlMapClientTemplate().queryForObject(":queryStudentById"?} } 7. Ibatis总配置文件;[html] view plain copy print,<xml version="1.0"encoding。UTF-8">?ibatis.apache.org/http;//ibatis.apache.org/dtd/sql-map-config-2.dtd"<-- 配置Ibatis要使用的SqlMap文件信息 -->student.xml"8. spring配置文件;SQLMapClient.xml;<,xml version=":1.0"?encoding="UTF-8"?SPRING/DTD BEAN/!EN"http;//www.springframework.org/dtd/spring-beans.dtd"-- 相关数据源和事务管理的定义 -->:org.springframework.jdbc.datasource.DriverManagerDataSource">!com.mysql.jdbc.Driver"url"jdbc;mysql;/:>:username":password"value="157891"org.springframework.orm.ibatis.SqlMapClientFactoryBean"studentDao"class="com.lanp.dao.StudentDaoImpl"ref bean="sqlMapClient"/>property></bean><package com.lanp.beans;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;import com.lanp.dao.StudentDao;1.初始化beans.xml文件 ApplicationContext ctx = new ClassPathXmlApplicationContext("SQLMapClient.xml"/2.获取MYDB数据库Student表中的内容 StudentDao studentDao = (StudentDao)ctx.getBean("studentDao"= studentDao) { Student student = studentDao.getStudent("ph"if(null!== 学生名字:"学生密码,+ student.getPsw());== 没有该学生信息;4.spring-ibatis怎样通过点击button向数据库添加数据csdn1. 环境:将以下jar包加入到工程,commons-logging-1.0.4.jar、ibatis-2.3.0.677.jar、mysql-connector-java-5.0.3-bin.jar、spring.jar。2. 在MySQL中创建数据库和相应的表:[sql] view plain copy print?############################################################################################# CREATE DATABASE MYDB; use MYDB; Drop TABLE IF EXISTS `MYDB`.`student`; Create TABLE `MYDB`.`student` ( `name` varchar(40) NOT NULL, `psw` varchar(10) NOT NULL, `enabled` boolean ); insert into student values("lanp","lanpiao",true); insert into student values("ph","ph",true); insert into student values("wxh","wxh",true); 3. 创建实体Bean,Student.java[java] view plain copy print?package com.lanp.beans; import java.io.Serializable; /** * Student Bean * @author LanP * @since 2011-11-27 15:36 * @version V1.0 */ public class Student implements Serializable { private static final long serialVersionUID = -7163004163334815825L; private String name; private String psw; private Boolean enabled; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPsw() { return psw; } public void setPsw(String psw) { this.psw = psw; } public Boolean getEnabled() { return enabled; } public void setEnabled(Boolean enabled) { this.enabled = enabled; } } 4. 创建Student实体Bean与数据库映射的SQLMap文件,student.xml:[html] view plain copy print?<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <sqlMap> <!-- 为Person类设置一个别名 --> <typeAlias alias="student" type="com.lanp.beans.Student"/> <!-- 配置表和实体Bean之间的映射关系 --> <resultMap id="studentMap" class="com.lanp.beans.Student"> <result property="name" column="name"/> <result property="psw" column="psw"/> <result property="enabled" column="enabled"/> </resultMap> <insert id="insertStudent" parameterClass="student"> <![CDATA[ insert into student values(#name#,#psw#,#enabled#); ]]> </insert> <!-- 查看特定用户 --> <select id="queryStudentById" parameterClass="string" resultMap="studentMap"> <![CDATA[ SELECT * FROM STUDENT WHERE NAME=#name# ]]> </select> <!-- 查看所有的用户 --> <select id="queryAllStudents" resultMap="studentMap"> <![CDATA[ SELECT * FROM STUDENT ]]> </select> </sqlMap> 5. 创建访问数据库的DAO接口,StudentDao.java:[java] view plain copy print?package com.lanp.dao; import com.lanp.beans.Student; public interface StudentDao { Student getStudent(String name); } 6. 创建访问数据库的DAO接口实现类,StudentDaoImpl.java:[java] view plain copy print?package com.lanp.dao; import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport; import com.lanp.beans.Student; public class StudentDaoImpl extends SqlMapClientDaoSupport implements StudentDao { @Override public Student getStudent(String name) { try{ return (Student)getSqlMapClientTemplate().queryForObject("queryStudentById", name); } catch(Exception e) { e.printStackTrace(); } return null; } } 7. Ibatis总配置文件,sqlMapConfig.xml:[html] view plain copy print?<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <sqlMapConfig> <!-- 配置Ibatis要使用的SqlMap文件信息 --> <sqlMap resource="com/lanp/beans/student.xml"/> </sqlMapConfig> 8. spring配置文件,SQLMapClient.xml:[html] view plain copy print?<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <!-- 相关数据源和事务管理的定义 --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://127.0.0.1:3306/MYDB"/> <property name="username" value="root"/> <property name="password" value="157891"/> </bean> <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation"> <value>sqlMapConfig.xml</value> </property> <property name="dataSource"> <ref bean="dataSource"/> </property> </bean> <bean id="studentDao" class="com.lanp.dao.StudentDaoImpl"> <property name="sqlMapClient"> <ref bean="sqlMapClient"/> </property> </bean> </beans> 9. 测试类,TestStudent:[java] view plain copy print?package com.lanp.beans; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.lanp.dao.StudentDao; /** * 测试Ibatis * @author LanP * @since 2011-11-27 15:36 * @version V1.0 */ public class TestStudent { public static void main(String[] args) { //1.初始化beans.xml文件 ApplicationContext ctx = new ClassPathXmlApplicationContext("SQLMapClient.xml"); //2.获取MYDB数据库Student表中的内容 StudentDao studentDao = (StudentDao)ctx.getBean("studentDao"); if(null != studentDao) { Student student = studentDao.getStudent("ph"); if(null != student) { System.out.println("== 学生名字:" + student.getName() + ",学生密码:" + student.getPsw()); } else { System.out.println("== 没有该学生信息!"); } } else { System.out.println("== StudentDao注入失败!"); } } } OK,TKS!5.linux使用什么命令查看端口 ?netstat命令各个参数说明如下:指明显示TCP端口-u:指明显示UDP端口-l:仅显示监听套接字(所谓套接字就是使应用程序能够读写与收发通讯协议(protocol)与资料的程序)-p:显示进程标识符和程序名称,每一个套接字/端口都属于一个程序。不进行DNS轮询,显示IP(可以加速操作)即可显示当前服务器上所有端口及进程服务,于grep结合可查看某个具体端口及服务情况··netstat -ntlp /6.linux使用什么命令查看端口netstat命令各个参数说明如下:指明显示TCP端口-u:指明显示UDP端口-l:仅显示监听套接字(所谓套接字就是使应用程序能够读写与收发通讯协议(protocol)与资料的程序)-p:显示进程标识符和程序名称,每一个套接字/端口都属于一个程序。不进行DNS轮询,显示IP(可以加速操作)即可显示当前服务器上所有端口及进程服务,于grep结合可查看某个具体端口及服务情况··netstat -ntlp /查看当前所有tcp端口·netstat -ntulp |grep 80 /查看所有80端口使用情况·netstat -an | grep 3306 /查看所有3306端口使用情况·查看一台服务器上面哪些服务及端口netstat -lanp查看一个服务有几个端口。比如要查看mysqldps -ef |grep mysqld查看某一端口的连接数量,7.liunx怎么看mongodb已经启动成功要先建立好MongoDB 存放数据文件和日志文件的目录,此处建立在/data下:[root@localhost etc]# cd /data/[root@localhost data]# lsmongodb_data mongodb_log2.在MongoDB安装目录下的bin下使用mongod启动MongoDB,可查看是否启动成功了,默认端口号是27017,当然在启动时也可以指定未使用的其它端口。 复制全文下载全文 复制全文下载全文