Java Archives

  1. Java simulation for Brownian motion

    Here is the Java program written by me to simulate the Brownian motion. In this prac, I tried to use double buffering to improve the performances, but actually it is triple buffering. That’s because the JPane has already implemented the double buffering, so plus mine own copy of buffer to store the background coordinate system Continue reading...

  2. repaint(), paint() and update()

    Many Java programmers are befuddled by the three methods repaint(), paint(Graphics), and update(Graphics). This is because they are designed to work in a wide variety of circumstances, and they interact in a non-obvious fashion. This happens in several contexts in Java, but GUIs are the most obvious. The designers of Java wanted Java programs to Continue reading...

  3. FAQ about Java import

    1. Q: Does importing all classes in a package make my object file (.class or .jar) larger? A: No, import only tells the compiler where to look for symbols. 2. Q: Is it less efficient to import all classes than only the classes I need? A: No. The search for names is very efficient so Continue reading...

  4. java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 ‘xxx’ 无效

    根本原因: 访问数据库的用户有登录权限,但无操作表的权限 解决办法: 1. 在[企业控制台]窗口–[树]子窗口–[安全性]子树–[登录]项里将你使用的登陆用户的默认数据库设为你所使用的数据库。 2. 在[企业控制台]窗口–[树]子窗口–[安全性]子树–[登录]项里新增一个登录用户(在其中选择SQL Server 身份验证、服务器角色和要访问的数据库),以后便可用些新增用户访问你勾选的数据库了。 大家在用java连接ms sql时可能会这样的问题 原因是sa用户为系统用户,它虽然能够登陆数据库,但是数据库里边的权限都是dbo的,所以,我们现在为这个数据库重新建立一个用户. 当然,这个情况只发生在java里边. .net是不会这样的. 只要新建立一个用户,再在权限那分配权限做好就行了.

      Continue reading...