关于eclipse连接sql server2005报错 用户sa登录失败

各种方法都试过了,TCP开了 sql服务也开了,browser也重启了 ,sql驱动加载了 。。数据库可以登录,求大神帮忙啊。。。

3个回答

你数据库可以登录,是用sa登录的,还是用Windows集成验证登录的?请确保启用了sa登录

上面的答案有帮助吗?如果还有问题,请提出来,如果对答案满意,请顶一下,并标记为采纳答案,谢谢!

你这个跟什么TCP的没关系,那个一般是sa的密码问题或者没开启混合身份验证

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
eclipse连接数据库失败,用户‘sa’登录失败

E Code18456 E M用户 'sa' 登录失败。 ClientConnectionId:0043747c-4de9-4ab6-98c8-0eca670db7eb

连接sqlserver2008数据库失败或超时,重启计算机就可以连接

连接sqlserver2008数据库失败或超时,重启计算机就可以连接。每天大概要发生一次。 数据库日志文件:2017-03-30 19:42:26.08 Server Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64) Jul 9 2008 14:17:44 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) 2017-03-30 19:42:26.15 Server (c) 2005 Microsoft Corporation. 2017-03-30 19:42:26.15 Server All rights reserved. 2017-03-30 19:42:26.15 Server Server process ID is 1540. 2017-03-30 19:42:26.17 Server System Manufacturer: 'LENOVO', System Model: 'ThinkServer TS250'. 2017-03-30 19:42:26.17 Server Authentication mode is MIXED. 2017-03-30 19:42:26.17 Server Logging SQL Server messages in file 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\ERRORLOG'. 2017-03-30 19:42:26.19 Server This instance of SQL Server last reported using a process ID of 1672 at 2017/3/30 19:41:32 (local) 2017/3/30 11:41:32 (UTC). This is an informational message only; no user action is required. 2017-03-30 19:42:26.19 Server Registry startup parameters: -d D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\master.mdf -e D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\ERRORLOG -l D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\mastlog.ldf 2017-03-30 19:42:26.25 服务器 SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2017-03-30 19:42:26.25 服务器 Detected 4 CPUs. This is an informational message; no user action is required. 2017-03-30 19:42:26.58 服务器 Using locked pages for buffer pool. 2017-03-30 19:42:27.35 服务器 Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required. 2017-03-30 19:42:33.69 服务器 Node configuration: node 0: CPU mask: 0x000000000000000f Active CPU mask: 0x000000000000000f. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required. 2017-03-30 19:42:34.11 spid7s Starting up database 'master'. 2017-03-30 19:42:34.33 spid7s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required. 2017-03-30 19:42:34.60 spid7s Resource governor reconfiguration succeeded. 2017-03-30 19:42:34.61 spid7s SQL Server Audit is starting the audits. This is an informational message. No user action is required. 2017-03-30 19:42:34.63 spid7s SQL Server Audit has started the audits. This is an informational message. No user action is required. 2017-03-30 19:42:34.72 spid7s FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'. 2017-03-30 19:42:35.22 spid7s SQL Trace ID 1 was started by login "sa". 2017-03-30 19:42:35.36 spid7s Starting up database 'mssqlsystemresource'. 2017-03-30 19:42:35.39 spid7s The resource database build version is 10.00.1600. This is an informational message only. No user action is required. 2017-03-30 19:42:35.75 spid11s Starting up database 'model'. 2017-03-30 19:42:35.75 spid7s Server name is 'PDASCAN'. This is an informational message only. No user action is required. 2017-03-30 19:42:35.90 spid11s Clearing tempdb database. 2017-03-30 19:42:36.29 服务器 A self-generated certificate was successfully loaded for encryption. 2017-03-30 19:42:36.31 服务器 Server is listening on [ 'any' <ipv6> 1433]. 2017-03-30 19:42:36.31 服务器 Server is listening on [ 'any' <ipv4> 1433]. 2017-03-30 19:42:36.31 服务器 Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ]. 2017-03-30 19:42:36.31 服务器 Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ]. 2017-03-30 19:42:36.31 服务器 Server is listening on [ ::1 <ipv6> 1434]. 2017-03-30 19:42:36.31 服务器 Server is listening on [ 127.0.0.1 <ipv4> 1434]. 2017-03-30 19:42:36.31 服务器 Dedicated admin connection support was established for listening locally on port 1434. 2017-03-30 19:42:36.31 服务器 The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies. 2017-03-30 19:42:36.31 服务器 SQL Server is now ready for client connections. This is an informational message; no user action is required. 2017-03-30 19:42:36.51 spid11s Starting up database 'tempdb'. 2017-03-30 19:42:36.73 spid14s The Service Broker protocol transport is disabled or not configured. 2017-03-30 19:42:36.73 spid14s The Database Mirroring protocol transport is disabled or not configured. 2017-03-30 19:42:36.83 spid14s Service Broker manager has started. 2017-03-30 19:42:36.84 登录 错误: 18456,严重性: 14,状态: 38。 2017-03-30 19:42:36.84 登录 Login failed for user 'SZBX_DBLinker'. 原因: 无法打开明确指定的数据库。 [客户端: 172.16.100.47] 2017-03-30 19:42:36.87 登录 错误: 18456,严重性: 14,状态: 38。 2017-03-30 19:42:36.87 登录 Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. 原因: 无法打开明确指定的数据库。 [客户端: 172.16.100.80] 2017-03-30 19:42:37.50 登录 错误: 18456,严重性: 14,状态: 38。 2017-03-30 19:42:37.50 登录 Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. 原因: 无法打开明确指定的数据库。 [客户端: <local machine>] 2017-03-30 19:42:37.79 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:37.79 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.01 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.01 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.02 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.02 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.04 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.04 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.24 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.24 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.26 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.26 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.27 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.27 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.27 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.27 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236] 2017-03-30 19:42:38.29 登录 错误: 18456,严重性: 14,状态: 8。 2017-03-30 19:42:38.29 登录 Login failed for user 'sa'. 原因: 密码与所提供的登录名不匹配。 [客户端: 180.97.83.236]

MyEclipse连接不上SqlServer

今天JSP学了连接数据库,但是无论怎样我都没法连接上数据库。。。麻烦各位大神帮一下, 代码:![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113658_368443.png) 报错:![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113686_399392.png) SqlServer的一些设置: 根据网上改了,但是也不行,我两个登录名都试过了,sa 还是 EDISON Edison都不行 ![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113852_563937.png) ![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113859_863801.png) ![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113871_86129.png) ![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113877_642986.png) ![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113916_309982.png) ![图片说明](https://img-ask.csdn.net/upload/201711/08/1510113923_946670.png) 再次麻烦各位大神啊!搞了好久都没法子搞好,要爆炸了。。。在不搞好课堂就跟不上了!! HELP!!!感激不尽啊!!!!

myeclipse导入eclipse项目报错,依赖报错,

这个项目在别人eclipse那里部署成功,所以不是代码问题 报错信息: Error creating bean with name 'attachmentController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.jeefw.service.sys.AttachmentService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, lookup=, authenticationType=CONTAINER)} 配置文件内容: ``` <context:annotation-config /> <context:component-scan base-package="com.jeefw.controller.sys,com.jeefw.dao.sys,com.jeefw.model.sys,com.jeefw.service.sys" /> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/jeefw?useUnicode=true&amp;characterEncoding=utf-8" /> <property name="user" value="root" /> <property name="password" value="123456" /> <!-- SQL Server数据库配置 --> <!-- <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> <property name="jdbcUrl" value="jdbc:sqlserver://localhost:1433;DatabaseName=jeefw" /> <property name="user" value="sa" /> <property name="password" value="123456" /> --> <!-- Oracle数据库配置 --> <!-- <property name="driverClass" value="oracle.jdbc.driver.OracleDriver" /> <property name="jdbcUrl" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /> <property name="user" value="SYSTEM" /> <property name="password" value="SkyNet888999" /> --> <property name="acquireIncrement" value="3" /> <property name="idleConnectionTestPeriod" value="120" /> <property name="initialPoolSize" value="3" /> <property name="minPoolSize" value="3" /> <property name="maxPoolSize" value="15" /> <property name="numHelperThreads" value="3" /> <property name="preferredTestQuery" value="select 1" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop> <!-- SQL Server的Dialect方言配置 --> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> --> <!-- Oracle的Dialect方言配置 --> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> --> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.use_outer_join">true</prop> <prop key="hibernate.jdbc.fetch_size">30</prop> <prop key="hibernate.jdbc.batch_size">30</prop> <prop key="hibernate.jdbc.batch_versioned_data">true</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop> <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop> <prop key="hibernate.current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="javax.persistence.validation.mode">none</prop> <!-- 此注释里代码只跟全文检索有关,如需全文检索功能,放开注释,然后找到本文件的第87行和web.xml的第15行放开注释,重启应用服务器即可。可配置,不影响框架使用。苹果Mac电脑需要修改hibernate.search.default.indexBase参数。 --> <!-- <prop key="hibernate.search.default.directory_provider">filesystem</prop> <prop key="hibernate.search.default.indexBase">D:/JeefwLuceneIndexes</prop> <prop key="hibernate.search.default.refresh">1800</prop> <prop key="hibernate.search.default.indexwriter.max_merge_docs">100</prop> <prop key="hibernate.search.default.indexwriter.ram_buffer_size">64</prop> <prop key="hibernate.search.default.optimizer.operation_limit.max">1000</prop> <prop key="hibernate.search.default.optimizer.transaction_limit.max">100</prop> --> </props> </property> <property name="dataSource" ref="dataSource" /> <property name="packagesToScan"> <list> <value>com.jeefw.model</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <!-- 此注释里代码的作用是应用服务器每次启动都生成索引。在SystemInitListener里执行。可配置,不影响框架使用。 --> <!-- <bean id="informationService" class="com.jeefw.service.sys.impl.InformationServiceImpl" /> --> <bean id="indexingInformationJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="informationServiceImpl" /> <property name="targetMethod" value="indexingInformation" /> </bean> <!-- 每天凌晨2点执行定时任务,生成索引。 --> <bean id="indexingInformationJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <property name="jobDetail" ref="indexingInformationJob" /> <property name="cronExpression" value="0 0 2 * * ?" /> </bean> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false"> <property name="triggers"> <list> <ref bean="indexingInformationJobTrigger" /> </list> </property> </bean> <bean id="updateUserPwdLogicBean" class="com.app.logic.UpdateUserPwdLogicServer" /> <!-- 配置业务逻辑池 --> <bean id="logicExecuteWorkerEnginBean" class="com.app.logic.LogicExecuteWorkerEngine"> <property name="requestBeanTrans"> <map> <entry key="1302"> <value>com.app.bean.UpdateUserPwdRequestBean</value> </entry> </map> </property> <property name="logicPool"> <map> <entry key="1302"> <ref bean="updateUserPwdLogicBean" /> </entry> </map> </property> </bean> <!-- 配置接口传输操作协议对象 --> <bean id="transmissionBean" class="com.app.logic.Transmission"> </bean> ``` 数据源配置的密码我填的是错的密码,它不报数据库的错,却报这个错 换过tomcat的版本,也没用 我部署这个项目是通过在myeclipse里面新建一个web项目,然后把要用的文件夹一个一个copy过来的,配置文件和jar包也是,整个项目的配置我只改动了数据源的密码

java连接无法打开登陆所请求的数据库“ ” 登录失败

![图片说明](https://img-ask.csdn.net/upload/201508/01/1438402850_821393.png) public void doGet(HttpServletRequest req,HttpServletResponse res){ Connection ct=null; Statement sm=null; ResultSet rs=null; try{ System.out.println("1"); //接受用户和密码 String u=req.getParameter("usrename"); String p=req.getParameter("passwd"); //连接数据库 Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); //得到连接 ct=DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=spdb","sa","123456"); //创建Statement sm=ct.createStatement(); rs=sm.executeQuery("select top 1 *from users where username='"+u +"'and passwd='"+p+"'"); //验证 if(rs.next()){ //将用户名和密码放入到session HttpSession hs=req.getSession(true); hs.setMaxInactiveInterval(30); hs.setAttribute("uname",u); //合法 res.sendRedirect("wel?uname="+u+"&pass="+p); }else{ //不合法 //跳转 res.sendRedirect("login"); } 帮我看一下,为什么会出现这种问题?

java连接SqlServer数据库的问题

最近在搞java,想连个SqlServer连不上,可以加载驱动,但是连不上数据库。 数据库版本为SqlServer2017 代码如下: ``` package util; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Connection; import java.sql.Statement; import java.sql.ResultSet; import java.sql.Date; public class DBManager { static int num; static Statement st=null; static ResultSet rs=null; static Connection con=null; static String url="jdbc:sqlserver://LAPTOP-LG07MEUA:1433;DataBaseName=Java_Data"; public static void exec(String s) throws SQLException { String user,passwd; user="sa"; passwd="1234567"; try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); System.out.println("数据库驱动加载成功。"); } catch (ClassNotFoundException e) { e.printStackTrace(); } //就是这里,无法链接数据库 con=DriverManager.getConnection(url, user, passwd); System.out.println("10"); st=con.createStatement(); System.out.println("1"); try { if(s.startsWith("select")||s.startsWith("SELECT")) rs=st.executeQuery(s); if(s.startsWith("delete")||s.startsWith("DELETE")) num=st.executeUpdate(s); if(s.startsWith("update")||s.startsWith("UPDATE")) num=st.executeUpdate(s); if(s.startsWith("insert")||s.startsWith("INSERT")) num=st.executeUpdate(s); System.out.println("修改成功!"); } catch(Exception e) { System.out.println("进行数据库修改时失败。"); } finally { try { if(rs!=null) rs.close(); if(st!=null) st.close(); if(con!=null) con.close(); } catch(SQLException e) { e.printStackTrace(); } } } public static void main(String[] args) throws SQLException { int i=0; int[] Resultage=new int [20]; String[] Resultxh=new String [20]; String[] Resultxm=new String [20]; String[] Resultxb=new String [20]; String[] Resultzy=new String [20]; Date[] Resultdate=new Date [20]; String s="SELECT * FROM xsb"; DBManager.exec(s); System.out.println("学号"+""+"姓名"+" "+"性别"+" "+"出生日期"+" "+"专业"+" "+"年龄"); while(rs.next()) { Resultxh[i]=rs.getString("学号"); Resultxm[i]=rs.getString("姓名"); Resultxb[i]=rs.getString("性别"); Resultdate[i]=rs.getDate("出生日期"); Resultzy[i]=rs.getString("专业"); Resultage[i]=rs.getInt("年龄"); System.out.print(Resultxh[i]+" "); System.out.print(Resultxm[i]+" "); System.out.print(Resultxb[i]+" "); System.out.print(Resultdate[i]+" "); System.out.print(Resultzy[i]+" "); System.out.println(Resultage[i]); } } } 报错为: 数据库驱动加载成功。 Exception in thread "main" java.lang.NullPointerException at javax.xml.bind.DatatypeConverter.parseHexBinary(DatatypeConverter.java:310) at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4098) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3160) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:43) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3123) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1981) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1628) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1168) at java.sql/java.sql.DriverManager.getConnection(Unknown Source) at java.sql/java.sql.DriverManager.getConnection(Unknown Source) at util.DBManager.exec(DBManager.java:27) at util.DBManager.main(DBManager.java:72) ``` 求大佬帮忙解答。

eclipse导入连接数据库需要的三个jar包后,还是连不上数据库

代码如下: mport java.sql.*; import java.util.Vector; import javax.swing.*; public class Test1 extends JFrame{ JTable jt=null; JScrollPane jsp=null; Vector rowData=null; Vector columnName=null; Connection cn=null; PreparedStatement ps=null; ResultSet rs=null; public static void main(String[] args) { // TODO Auto-generated method stub Test1 t1=new Test1(); } public Test1() { columnName=new Vector(); columnName.add("学生编号"); columnName.add("学生名"); columnName.add("性别"); columnName.add("年龄"); columnName.add("籍贯"); columnName.add("所在系"); rowData=new Vector(); try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); cn=DriverManager.getConnection(/*"jdbc:odbc:mytest"*/"jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=test","sa","sa"); ps=cn.prepareStatement("select * from stu"); rs=ps.executeQuery(); while(rs.next()) { Vector hang=new Vector(); String stuId=rs.getString(1); hang.add(stuId); String stuName=rs.getString(2); hang.add(stuName); String stuSex=rs.getString(3); hang.add(stuSex); int stuAge=rs.getInt(4); hang.add(stuAge); String stuJG=rs.getString(5); hang.add(stuJG); String stuDept=rs.getString(6); hang.add(stuDept); rowData.add(hang); } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); }finally{ try { if(rs!=null) rs.close(); if(ps!=null) ps.close(); if(cn!=null) cn.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } jt=new JTable(rowData,columnName); jsp=new JScrollPane(jt); this.add(jsp); this.setLocation(400, 300); this.setSize(300,200); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setVisible(true); } } 报错如下: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.class69.Test1.<init>(Test1.java:35) at com.class69.Test1.main(Test1.java:20) ![CSDN移动问答][1] [1]: http://115.com/?mode=wangpan 请问:这是哪里出问题了?

gwt连接数据库总是报错

下面的代码只不过是将eclipse或用webAppCreator产生的service类的方法体变了一下,然后错误就开始了, mysql与sqlserver都报错,说是没有权限访问.请问如何解决啊(不要说什么让我换个驱动,不通过gwt是可以正常取到数据的). public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { public String greetServer(String input) { try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DatabaseName=zg", "sa", "sa"); List<String> userList = new ArrayList<String>(); Statement stmt = null; ResultSet rs = null; try { stmt = conn.createStatement(); rs = stmt.executeQuery("select * from user"); while (rs.next()) { userList.add(rs.getString(1) + " " + rs.getString(2) + " " + rs.getString(3)); System.out.println(rs.getString(1) + " " + rs.getString(2) + " " + rs.getString(3)); } } catch (SQLException e) { e.printStackTrace(); } return userList.get(0); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } } 异常: SEVERE: [1262763541078000] javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String org.zengge.gwt.demo.client.GreetingService.greetServer(java.lang.String)' threw an unexpected exception: java.security.AccessControlException: access denied (java.net.SocketPermission localhost:1433 connect,resolve) at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224) at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:713) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:51) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:121) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:352) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:844) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission localhost:1433 connect,resolve) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151) at java.lang.SecurityManager.checkConnect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnectionSecurityManager.checkConnect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.zengge.gwt.demo.server.GreetingServiceImpl.greetServer(GreetingServiceImpl.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562) ... 30 more

访问MySQL数据库报错?

eclipse下创建Java项目可以用c3p0获取数据库连接。 创建web项目登陆访问到数据库就报错,c3p0配置文件都一样的。两个项目报一样的错,请大神指点。非常感谢。 警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@aa811c5 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670) at com.mysql.jdbc.Connection.<init>(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:156) at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:285) at cn.itcast.dao.UserDaoImple.login(UserDaoImple.java:18) at cn.itcast.service.UserService.login(UserService.java:11) at cn.itcast.action.UserServlet.login(UserServlet.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cn.itcast.utils.BaseServlet.service(BaseServlet.java:33) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 28 more java.lang.RuntimeException: 鐢ㄦ埛鐧诲綍澶辫触! at cn.itcast.dao.UserDaoImple.login(UserDaoImple.java:21) at cn.itcast.service.UserService.login(UserService.java:11) at cn.itcast.action.UserServlet.login(UserServlet.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cn.itcast.utils.BaseServlet.service(BaseServlet.java:33) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 十一月 14, 2018 6:23:21 下午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run 警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@39f301dc -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670) at com.mysql.jdbc.Connection.<init>(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 十一月 14, 2018 6:23:21 下午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run 警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@62ae4cb6 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670) at com.mysql.jdbc.Connection.<init>(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

Hibernate 不能插入数据问题[不允许从数据类型 datetime 到数据类型 timestamp 的隐性转换]

小弟新手,在学习hibernate时碰到如下问题 log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Hibernate: insert into oa_employee (name, birthdayDate, id) values (?, ?, ?) org.hibernate.exception.GenericJDBCException: could not insert: [com.wl.Employee.Employee] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at com.wl.hibernate.test.UserTest.test1(UserTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]不允许从数据类型 datetime 到数据类型 timestamp 的隐性转换(表 'oa.dbo.oa_employee',列 'birthdayDate')。请使用 CONVERT 函数来运行此查询。 at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source) at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source) at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source) at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source) at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source) at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source) at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source) at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source) at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) ... 29 more Employee.java [code="java"] package com.wl.Employee; import java.util.Date; public class Employee { private String id ; private String name; private Date birthday; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } } [/code] ExportDB.java [code="java"] package com.wl.hibernate.util; import org.hibernate.cfg.Configuration; import org.hibernate.tool.hbm2ddl.SchemaExport; public class ExportDB { public static void main(String[] args) { //读取hibernate.cfg.xml文件 Configuration cfg = new Configuration().configure(); SchemaExport export = new SchemaExport(cfg); export.create(true, true); } } [/code] Employee.hb.xml [code="xml"] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.wl.Employee"> <class name="Employee" table="oa_employee"> <id name="id"> <generator class="uuid"/> </id> <property name="name"/> <property name="birthday" type="timestamp" column="birthdayDate"/> </class> </hibernate-mapping> [/code] hibernate.cfg.xml [code="xml"] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory name="foo"> <property name="hibernate.show_sql">true</property> <property name="hibernate.connection.driver_class"> com.microsoft.jdbc.sqlserver.SQLServerDriver </property> <property name="hibernate.connection.url"> jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=oa </property> <property name="hibernate.connection.username">sa</property> <property name="hibernate.connection.password">sa</property> <property name="hibernate.dialect"> org.hibernate.dialect.DB2Dialect </property> <property name="hibernate.hbm2ddl.auto">update</property> <mapping resource="com/wl/Employee/Employee.hb.xml" /> </session-factory> </hibernate-configuration> [/code] UserTest.java [code="java"] package com.wl.hibernate.test; import java.sql.Timestamp; import java.util.List; import java.util.Date; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.Transaction; import junit.framework.TestCase; import com.wl.Employee.Employee; import com.wl.hibernate.util.*; public class UserTest extends TestCase { public static String EmployeeID = &quot;&quot; ; public void test1(){ Session session = null ; Transaction tx = null; Employee Employee = null ; try{ session = HibernateUtil.getSession(); tx = session.getTransaction(); tx.begin(); Employee = new Employee(); Employee.setName("王五"); Employee.setBirthday(new Timestamp(System.currentTimeMillis())); session.save(Employee); Employee = new Employee(); Employee.setName("赵六"); Employee.setBirthday(new Timestamp(System.currentTimeMillis())); session.save(Employee); Employee = new Employee(); Employee.setName("张三"); Employee.setBirthday(new Timestamp(System.currentTimeMillis())); session.save(Employee); Employee = new Employee(); Employee.setName("李四"); Employee.setBirthday(new Timestamp(System.currentTimeMillis())); session.save(Employee); this.setEmployeeID(Employee.getId()); tx.commit(); }catch(Exception e){ e.printStackTrace(); tx.rollback(); }finally{ if(session!=null){ HibernateUtil.closeSession(session); } } } public static void setEmployeeID(String employeeID){ EmployeeID = employeeID ; } public static String getEmployeeID(){ return EmployeeID ; } } [/code] 无论setBirthday()中的参数是Date还是Timestamp类型全部报一样的错误,各位高手下小弟感激不尽

java.io.StreamCorruptedException: invalid stream header: 77327070是什么情况如何解决?

springboot+datajpa+sqlserver报Caused by: invalid stream header: 77327070是什么情况如何解决? 刚接触springboot+jpa的小白,拜求各路大神的帮忙: 开发工具是eclipse: 没写controller层,先用junit测试crud(即增删改查)中其中的修改和删除,不能用,代码如下: 实体编译好后 1.首先JpaRepository层用的完全是继承JpaRepository的借口自带方法,出查询外没用自定义任何修改: @Repository @Transactional public interface sd extends JpaRepository<sd, String>{ Page<sd> findAll(Pageable pageable); } ```2.service 层是: @Override @Modifying @Transactional public void delete(String pid) { // TODO Auto-generated method stub cd.deleteById(pid); } @Override public boolean update(sd sf) { // TODO Auto-generated method stub cd.save(cfb); return true; } 3.测试类中: @Test @Modifying @Transactional public void deletepro() { cps.delete("fef232"); } @Test public void querypro() { /* int page=1,size=10; Sort sort = new Sort(Direction.DESC, "pid"); Pageable pageable = new PageRequest(page, size, sort); System.out.println(cps.findByPages(pageable));*/ } ``4.具体报错为: **org.hibernate.type.SerializationException: could not deserialize** at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191] .......(太长了懒得粘了省略) **Caused by: java.io.StreamCorruptedException: invalid stream header: 77327070 ** at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:866) ~[na:1.8.0_191] at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358) ~[na:1.8.0_191] at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:309) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:299) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:218) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] ... 110 common frames omitted 5,配置用的是:application.properties 具体是: #port is update server.port=8080 #connection spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver spring.datasource.url=jdbc:sqlserver://localhost:1433;DatabaseName=tzc12 spring.datasource.username=sa1 spring.datasource.password=qq hibernate.dialect=org.hibernate.dialect.SQLServerDialect spring.jpa.properties.hibernate.show_sql=true spring.jpa.hibernate.ddl-auto = update # Naming strategy spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy #controller spring.mvc.view.prefix=/ spring.mvc.view.suffix=.jsp #Connection Pool spring.datasource.initialSize=5 spring.datasource.minIdle=5 spring.datasource.maxActive=20 spring.datasource.maxWait=60000 spring.datasource.timeBetweenEvictionRunsMillis=60000 spring.datasource.minEvictableIdleTimeMillis=300000 spring.datasource.validationQuery=SELECT 1 FROM DUAL spring.datasource.testWhileIdle=true spring.datasource.testOnBorrow=false spring.datasource.testOnReturn=false ``` 除外,测试查询方法时junit未报错,但出现了以下情况是什么原因?如何解决: JpaRepository层看最上面 service层: @Override public Page<sd> findByPages(Pageable pageable) { // TODO Auto-generated method stub return cd.findAll(pageable); } @Test public void querypro() { int page=1,size=10; Sort sort = new Sort(Direction.DESC, "pid"); Pageable pageable = new PageRequest(page, size, sort); System.out.println(cps.findByPages(pageable)); } 结果出来为: Page 2 of 1 containing UNKNOWN instances 更新后: 实体类: sd为主表,cds为附表,即cds 的主键是sd的外键。 @Entity @Table(name="cftbiop") public class sd implements Serializable{ /** * */ private static final long serialVersionUID = 8786038170195933216L; @Id private String pid=(UUID.randomUUID().toString()) ; private String pname ; private String introduction; private String marque; private String showcase; private String waytoraise ; private int suppot; private int raisefunds ; private int goalnum ; private cds showid; @ManyToOne @JoinColumn(name="showid") public cds getShowid() { return showid; } public void setShowid(CFShowProspecification showid) { this.showid = showid; } private boolean homepagedisplay; private int price; 其余getter,setter省略不粘了,都已getter,setter, 测试查询方法,把page改为0后,报了和删除,修改一样的错误

还是ibatis的中文乱码问题

jdk 1.6 <br />eclipse 3.3 <br />sqlserver2000 <br />ibatis2.3 <br />在执行数据插入时出现乱码。多方查找资料,仍无法解决;源码如下: <br /><span style="font-size: x-large;">sqlMapConfig.xml</span> <br /> <br /> <br />&lt;sqlmapconfig&gt; <br /> &lt;transactionmanager type="JDBC"&gt; <br /> &lt;datasource type="SIMPLE"&gt; <br /> &lt;property name="JDBC.Driver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"&gt; <br /> &lt;property name="JDBC.ConnectionURL" value="jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=UserDB;SelectMethod=Cursor"&gt; <br /> &lt;property name="JDBC.Username" value="sa"&gt; <br /> &lt;property name="JDBC.Password" value="sa"&gt; <br /> &lt;/datasource&gt; <br /> &lt;/transactionmanager&gt; <br /> &lt;sqlmap resource="com/hanhl/map/User.xml"&gt;&lt;/sqlmap&gt; <br />&lt;/sqlmapconfig&gt; <br /><span style="font-size: x-large;">User.xml:</span> <br /> <br /> <br />&lt;sqlmap namespace="User"&gt; <br /> &lt;select id="getuser"&gt; <!----> <!----> &lt;/select&gt; <br /> &lt;select id="getAlluser"&gt; <!----> <!----> &lt;/select&gt; <br /> &lt;insert id="insertuser" parameterclass="com.hanhl.obj.User"&gt; <br /> <br /> <br /> &lt;/insert&gt; <br /> &lt;delete id="delete user" parameterclass="int"&gt; <br /> <br /> <br /> &lt;/delete&gt; <br />&lt;/sqlmap&gt; <br /><span style="font-size: x-large;">User:</span> <br />package com.hanhl.obj; <br /> <br />import java.io.Serializable; <br /> <br />@SuppressWarnings("serial") <br />public class User implements Serializable { <br /> private int id; <br /> private String name; <br /> private int sex; <br />public int getId() { <br /> return id; <br />} <br />public void setId(int id) { <br /> this.id = id; <br />} <br />public String getName() { <br /> return name; <br />} <br />public void setName(String name) { <br /> this.name = name; <br />} <br />public int getSex() { <br /> return sex; <br />} <br />public void setSex(int sex) { <br /> this.sex = sex; <br />} <br />} <br /> <br /> <br /><span style="font-size: x-large;">TestClass:</span> <br />package com.hanhl.unmi; <br /> <br />import java.io.Reader; <br />import java.nio.charset.Charset; <br />import java.util.Iterator; <br />import java.util.List; <br /> <br />import com.hanhl.obj.User; <br />import com.ibatis.common.resources.Resources; <br />import com.ibatis.sqlmap.client.SqlMapClient; <br />import com.ibatis.sqlmap.client.SqlMapClientBuilder; <br /> <br />public class MySqlMapConfig { <br /> <br /> @SuppressWarnings("unchecked") <br /> public static void main(String[] args) throws Exception{ <br /> //从配置文件中得到SqlMapClient对象 <br /> Reader reader = Resources.getResourceAsReader("com/hanhl/xml/salMapConfig.xml"); <br /> SqlMapClient sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader); <br /> reader.close(); <br /> <br /> //创建用户数据 <br /> for(int i=0; i&lt;10; i++){ <br /> User user = new User(); <br /> user.setName("我"); <br /> if(i%2==0){ <br /> user.setSex(0); <br /> }else{ <br /> user.setSex(1); <br /> } <br /> sqlMapper.insert("insertuser", user); <br /> } <br /> <br /> //查询用户数据 <br /> List users = sqlMapper.queryForList("getAlluser"); <br /> for (Iterator iter = users.iterator(); iter.hasNext();) { <br /> User user = (User) iter.next(); <br /> System.out.println(user.getId()); <br /> System.out.println(user.getName()); <br /> System.out.println(user.getSex()); <br /> } <br />// for(Iterator iter = users.iterator(); iter.hasNext();){ <br />// User user = (User) iter.next(); <br />// if(user.getSex()!=1||user.getSex()!=0){ <br />// sqlMapper.delete(String.valueOf(user.getId())); <br />// } <br />// } <br /> <br /> } <br /> <br /> <br />} <br /><span style="font-size: large;">以上信息在执行后,不出错,但是数据库中name字段为“ ”空格 ,无法显示插入的“我”,请各位指点,初次接触ibatis请各位提供宝贵学习资料,在下不甚感激......</span> <br /><br /><strong>问题补充:</strong><br />首先感谢各位的回答,我的这个程序是可以正常运行的,不会报错,而且数据也可插入到数据库,只是插入的数据如果为中文时,在数据库中看到的是乱码,比如“我” 插入后在数据库中为“ ”空格 ......

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

C++(数据结构与算法)78:---分而治之

一、分而治之的思想 分而治之方法与软件设计的模块化方法非常相似 分而治之通常不用于解决问题的小实例,而要解决一个问题的大实例。一般步骤为: ①把一个大实例分为两个或多个更小的实例 ②分别解决每个小实例 ③把这些小实例的解组合成原始大实例的解 二、实际应用之找出假币 问题描述 一个袋子有16个硬币,其中只有一个是假币,这个假币比其他的真币重量轻(其他所有真币的重量都是相同的)...

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

win10暴力查看wifi密码

刚才邻居打了个电话说:喂小灰,你家wifi的密码是多少,我怎么连不上了。 我。。。 我也忘了哎,就找到了一个好办法,分享给大家: 第一种情况:已经连接上的wifi,怎么知道密码? 打开:控制面板\网络和 Internet\网络连接 然后右击wifi连接的无线网卡,选择状态 然后像下图一样: 第二种情况:前提是我不知道啊,但是我以前知道密码。 此时可以利用dos命令了 1、利用netsh wlan...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

立即提问
相关内容推荐