消息 208,级别 16,状态 1,第 1 行 对象名 'students' 无效。

博客提到执行 'select * from students' 语句时出现错误,并表示会介绍修改数据库的方法,主要围绕MySQL数据库查询操作及错误处理展开。

执行 select * from students
出现如下错误
在这里插入图片描述
方法修改数据库
在这里插入图片描述

Nonqualified transactions are being rolled back. Estimated rollback completion: 0%. Nonqualified transactions are being rolled back. Estimated rollback completion: 100%. 消息 5075,级别 16状态 1,第 2 The object 'CK__Users__Role__24927208' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation. 消息 5075,级别 16状态 1,第 2 The object 'CK__Students__Gender__31EC6D26' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation. 消息 5075,级别 16状态 1,第 2 The object 'CK__Scores__ScoreVal__36B12243' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation. 消息 5075,级别 16状态 1,第 2 The object 'CK__TeacherRe__Statu__3C69FB99' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation. 消息 5075,级别 16状态 1,第 2 The object 'CK__HollandQu__Dimen__4D94879B' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation. 消息 5072,级别 16状态 1,第 2 ALTER DATABASE failed. The default collation of database 'D:\BACKUP\DOCUMENTS\XITONG.MDF' cannot be set to Chinese_PRC_CI_AS.
03-12
以下是一些关于 Java 继承和多态中子类对象特点的练习相关内容: ### 使用`instanceof`运算符判断对象实例 在 Java 中,可以使用`instanceof`运算符来判断一个对象是否为特定类的实例。以下代码演示了如何使用`instanceof`运算符判断不同对象是否为特定类的实例: ```java /** * 任务:使用 instanceof 运算符判断所给对象是否为特定类的一个实例,并输出判断结果。 */ public class Demo { public static void main(String[] args) { Object hello = "Hello"; // 判断hello是否是Object类的实例 System.out.println(hello instanceof Object); // 判断hello是否是String类的实例 System.out.println(hello instanceof String); // 判断hello是否是Math类的实例 System.out.println(hello instanceof Math); // 判断a是否是Object类的实例 String a = "hello"; System.out.println(a instanceof Object); } } ``` 在上述代码中,创建了`Object`类型的对象`hello`并赋值为字符串`"Hello"`,然后使用`instanceof`运算符分别判断`hello`是否为`Object`类、`String`类和`Math`类的实例,并输出判断结果。同时,创建了`String`类型的对象`a`,并判断`a`是否为`Object`类的实例[^1][^4]。 ### 不同子类对象对父类的实例判断 以下代码通过创建不同子类的对象,使用`instanceof`运算符判断这些对象是否为父类的实例: ```java class Person{} class Students extends Person{} class Sch extends Students{} public class Demos { public static void main(String[] args) { // 创建一个Students对象,判断该对象是否是Person类的实例 Students stu = new Students(); System.out.println(stu instanceof Person); // 创建一个Sch对象,判断该对象是否是Person类的实例 Sch s1 = new Sch(); System.out.println(s1 instanceof Person); // 创建一个Person对象,判断该对象是否是Students类的实例 Person p1 = new Person(); System.out.println(p1 instanceof Students); } } ``` 在这个例子中,定义了`Person`类、`Students`类(继承自`Person`类)和`Sch`类(继承自`Students`类)。在`main`方法中,分别创建了`Students`对象、`Sch`对象和`Person`对象,并使用`instanceof`运算符判断它们是否为`Person`类或`Students`类的实例,然后输出判断结果[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值