Mar 31st, 2008 by Kevin Couch
When you attempt to login to your database using SQL Server Authentication and you get an error message that says:
Cannot open user default database. Login failed. Login failed for user ‘usrLogin’. (Microsoft SQL Server, Error: 4064)
It might possibly be due to the fact that the database that was set up to be the default for that specific login has been deleted.
What you need to do is update the login to have a default database that you know exists. Here’s how to fix it. Open a command prompt and type the following:
For SQL 2005:
osql -S SQL01 -d master -U usrlogin -P usrpassword
ALTER LOGIN usrlogin WITH DEFAULT_DATABASE=new_default_db
For SQL 2000:
isql -S SQL01 -d master -U usrlogin -P usrpassword
(opens query analyzer, type the next line in there)
sp_defaultdb ‘usrlogin’, ‘ new_default_db’
If this didn’t fix the problem… try this link:
http://benharrell.wordpress.com/2007/01/15/cannot-open-user-default-database-login-failed-login-failed-for-user-username-microsoft-sql-server-error-4064/
Share This
Posted in Technology | No Comments »
Mar 29th, 2008 by Greg Alexander
Kiosk applications and other self-service systems are rapidly growing business area. Internet connectivity, a greater variety of interface equipment and prices that continue to drop are enabling the cost-effective deployment of an ever widening array of applications. Hardware is available for a wide spectrum of requirements. Vendors such as NCR and 5point can meet most any need
Kiosk Software application development is relatively straightforward. Many kiosk applications now use an ordinary PC attached to various more specialized interface equipment such as touchscreens, card readers, special keyboards, and trackballs. Equipment and kiosks can be purchased for either indoor or outdoor usage, outdoor equipment is noticably more expensive. Outdoor kiosks have special needs due to weather, water and sunlight.
Usually either .NET or Java is used as an application language. The operating system is either Linux or Windows XP. Kiosk applications can be a specialized web site program or more traditional client application. There are special security programs for controlling access and monitoring the kiosks (such as Kioware). These programs prevent access to the computer or any application other than those specifically permitted.
Touchscreen applications are much like any other except the interface elements typically have to be much larger. This can be especially challenging when working with spreadsheet like programs or interfaces. Most interface hardware available today has a well defined software API and can usually interact seamlessly with the programming.
Unidev recently completed two separate kiosk applications. One was an application which allowed visitors to search a large database of products and images to obtain detailed information about the products and pricing. By automatically providing this information on a round the clock basis, the vendor is able to interact with all potential customers even when salespeople are not available.
The other application provides an automated method for filling out and validating data entry forms by customers. This application saves a considerable amount of labor as well as ensures the data is correctly filled out and validated while the customer is on site saving considerable rework.
Both of these applications communicate with a central server for obtaining updates of both code and data, sending report information to the server and monitoring. The server applications provide a central data collection point for management reports.
Self-service kiosks have proven themselves to be a cost effective tool for both labor savings and improving service levels to customers.
Share This
Posted in Technology, About Unidev | 1 Comment »
Feb 17th, 2008 by Greg Alexander
2007 saw continued growth and expansion of the web marketing and web design service lines of The Net Impact business unit. The web development team went through a number of process changes over the year as staff was added. A new formal development methodology was implemented in conjunction with a new enterprise project management system. These changes allowed for much improved communications with customers and with other teams in the company. The Net Impact formed several strategic partnerships in the 4th quarter that will both expand the potential client base as well as significantly increase the sales efforts for the services.
The software development and outsourcing groups had the strongest growth for the Unidev business unit. Outsourcing development, production support and maintenance continues to be a strong and growing revenue contributor. The software development team primarily used .NET and J2EE this last year. We saw very little demand for other technologies. An important goal for 2007 was to improve development methodologies and processes in order to deploy products more rapidly. The software group implemented a much improved enterprise project management system tool as well as organizational and process changes to successfully meet this goal.
2007 was a year of significant growth and change within the company as The Net Impact became a fully integrated business unit. 2008 should be a great year as we continue to build and improve on 2007. For 2008 we will be working to increase our commercial applications integration services, developing new and improved technology solutions to web marketing and increasing our mobile applications development efforts.
Share This
Posted in News | No Comments »
Feb 11th, 2008 by Dhanya James
Java - Find a given date belongs in which quarter:
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern(”MM/dd/yyyy”);
Calendar calendar = Calendar.getInstance();
Date processDate = sdf.parse(”4/10/2007″);
calendar.setTime(processDate);
Date date1 = calendar.getTime();
int quarter = TestDate.getQuarter(date1);
System.out.println(”Quarter for the date : “+sdf.format(calendar.getTime())+” is : “+quarter);
Prints the following Result :
Quarter for the date : 04/10/2007 is : 2
Java - Code for getQuarter() function:
public static int getQuarter(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int[] months = { 3, 6, 9, 12 };
int count = 0;
do {
calendar.set(year, months[count++], 1);
Date tempDt = calendar.getTime();
if(date.compareTo(tempDt)
return count;
} while(count
return 0;
}
Java - Find previous quarter begin and end dates for a given date:
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern(”MM/dd/yyyy”);
Calendar calendar = Calendar.getInstance();
Date processDate = sdf.parse(”4/10/2007″);
calendar.setTime(processDate);
Date date1 = calendar.getTime();
int quarter = TestDate.getQuarter(date1);
String currentQuarterBeginDate = “”;
String fromDt=”";
String toDt=”";
if ( quarter ==1){
currentQuarterBeginDate = “01/01/”+calendar.get(Calendar.YEAR);
}
if ( quarter ==2){
currentQuarterBeginDate = “04/01/”+calendar.get(Calendar.YEAR);
}
if ( quarter ==3){
currentQuarterBeginDate = “07/01/”+calendar.get(Calendar.YEAR);
}
if ( quarter ==4){
currentQuarterBeginDate = “10/01/”+calendar.get(Calendar.YEAR);
}
calendar.setTime(sdf.parse(currentQuarterBeginDate));
calendar.add(Calendar.MONTH, 3*-1);
fromDt = sdf.format(calendar.getTime());
String formmatedQuarterBeginDate = sdf.format(calendar.getTime());
calendar.setTime(new java.util.Date(formmatedQuarterBeginDate));
calendar.add(Calendar.MONTH, 3);
calendar.add(Calendar.DAY_OF_MONTH, -1);
toDt = sdf.format(calendar.getTime());
System.out.println(”Previous Quarter Begin Date : “+fromDt);
System.out.println(”Previous Quarter End Date : “+toDt);
Prints the following Result :
Previous Quarter Begin Date : 01/01/2007
Previous Quarter End Date : 03/31/2007
Java - Find previous Date for a given date:
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern(”MM/dd/yyyy”);
Calendar calendar = Calendar.getInstance();
Date processDate = sdf.parse(”4/10/2007″);
calendar.setTime(processDate);
calendar.add(Calendar.DAY_OF_MONTH, -1);
String previousDate = sdf.format(calendar.getTime());
System.out.println(”Previous Date is :”+previousDate);
Prints the following Result :
Previous Date is :04/09/2007
Java - Find previous Sunday for a given date:
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern(”MM/dd/yyyy”);
Calendar calendar = Calendar.getInstance();
Date processDate = sdf.parse(”4/24/2007″);
calendar.setTime(processDate);
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
calendar.add(Calendar.DAY_OF_MONTH,-1*(dayOfWeek-1));
calendar.setTime(calendar.getTime());
String endDt = sdf.format(calendar.getTime());
System.out.println(”Previous Sunday is :”+endDt);
Prints the following Result :
Previous Sunday is :04/22/2007
Enjoy!!!!
Share This
Posted in Technology | 1 Comment »
Feb 8th, 2008 by George Zheng
Do you have performance issue on your ASP.NET website? Do you want to boost your site’s scalability? Do you know the bottleneck of your site? Do you want your site performs well under 100 times more traffic? Here are some good posts about this:
10 ASP.NET Performance and Scalability Secrets
Boost ASP.NET performance with deferred content loading
Share This
Posted in Technology | No Comments »
Oct 6th, 2007 by Greg Alexander
Keeping a medium sized contract programming company up to speed on the latest technologies is a daily challenge. With a wide variety of technologies and skillsets in use at any given time and with the future technology needs of the company being very customer driven, it can be very difficult to put together individualized training plans. Our solution was to develop a more ‘university’ environment where we constantly have optional classes on a wide variety of new and current technologies. In this way, employees are able to choose which directions they feel works best for them and they are able to investigate a variety of choices without having to commit to a particular path. In our experience, this has worked quite well with a number of surprises about which directions people choose. With an array of topics such as J2EE, C# .NET, Web Marketing methods, HTML, Project Management, RAD and Network Architecture, employees can explore many possibilities. Unidev has a number of types of work including software developers who work on customer projects at the development center, technology consultants who work both at the customer site and in-house, Web marketing consultants and IT staffing personnel who augment customer development teams. This variety of work along with the various technologies employed makes for a very interesting learning environment.
Share This
Posted in About Unidev | No Comments »
Sep 22nd, 2007 by George Zheng
We have a project which needs to show foreign language, like Chinese, on a web page. And we are using RICO 2.0, PHP, MySQL & ASP.NET in the project. To achieve this, we decide to use UTF-8 character set and the following changes need to be done:
To store UTF-8 in a table field, you need to set column’s charset => utf8 and collate => utf8_unicode_ci
To show foreign language in a web page, the page file has to be saved as encoding UTF-8
The default encoding for PHP 5 is UTF-8, so it supports foreign language. But if you use PHP to retrieve UTF-8 characters from MySQL, you must add mysql_query(’SET NAMES utf8′); after connecting to MySQL database for setting up the connection encoding.
As for RICO Live gird, Ajax response must start with <?xml version=”1.0″ encoding=”utf-8″?>
First make sure you have following line in you web.config
<globalization requestEncoding=”utf-8″ responseEncoding=”utf-8″ fileEncoding=”utf-8″/>
Second, keep both .aspx and code behind file save as the same encoding UTF-8
If you need to access the UTF-8 characters in MySQL database, be sure to use MySQL Connector/Net 5.0 or up with undocumented setting: charset=utf8 in connection string. We tried ODBC driver for MySQL, it doesn’t work properly with UTF-8.
Share This
Posted in Technology | No Comments »
Sep 4th, 2007 by Brian Bohl
We recently pushed a couple of new Java programs to our client’s application server (HPUX) and soon thereafter they started to receive alerts about the swap running out of space. Of course, being the “new kid on the block” our programs were suspect. While these programs were not the only ones taking up a good deal of swap space, we were a bit perplexed why they were taking much at all.
These programs were fairly small in terms of functionality, but the amount of swap space it was using was around 600-700MB. Here is a summary of our findings (note that some of these details might be different on a Windows system due to differences in memory management):
- A common theme is that most java processes have a big difference between the residual memory and the total virtual memory.
- Java will allocate at a minimum about 200 MB of swap even for the simplest of programs. We tested using a simple program on both a HPUX and a linux server. The best and only documentation I could find about this was at the URL below. The bottom line is that this is probably the behavior of the JVM and out of our control so we just have to deal with it.
http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/778089cbe0c9814c/5b0dfcea715d9055?lnk=st&q=java+uses+virtual+memory&rnum=20&hl=en#5b0dfcea715d9055It
It is reserving space for example for threads that you may or may not create. It is awkward to rearrange memory on the fly, so the JVM parcels out the virtual ram for various tables when it first loads.
- The -Xms and -Xmx parameters do affect the java heap but it does not control the total memory footprint. It is only a piece of the total size.
- -Xmx alone can affect the total virtual memory size. Currently the processes have -Xms24m and -Xmx512m. Immediately after starting these programs, we saw the swap allocation jump to 600-700MB. When we changed -Xmx to 24m, it dropped to a little over 200MB.
- In relation to the above, the normal behavior of the garbage collector is to garbage collect only when it needs to free up memory. Having a too high of a -Xmx value could mean that it will never garbage collect, which means it won’t reuse memory. We see this in the Weblogic environment too but in that environment all of the memory usually gets used at some point.
- There is a new tool built into Java 5 and up called jmap that will give you heap information about a java process. This tool would make tuning the heap parms really simple. Unfortunately the process also has to be running using Java 5 so we cannot use it at this time. There is a version for 1.4 but it only works on Solaris.
Share This
Posted in Technology | No Comments »
Aug 31st, 2007 by Brian Bohl
One of our applications was determined to be leaking memory. The leak was traced back to some stateful EJB’s that were extending Spring’s AbstractStatefulSession bean class. While I could not trace to the exact source of the leak, it seems to be related to the unloading of the BeanFactory.
As per the documentation, Spring’s default behavior will initialize a new ApplicationContext when the EJB object is created. It also states that the BeanFactory (which is the ApplicationContext) is unloaded when the EJB is removed.
One of the first things I checked was ensuring the EJB’s were in fact being removed. They were. At some point I remembered that in a more recent project, we changed the beanFactoryLocator to the ContextSingletonBeanFactoryLocator so that all EJBs use the same context (it also happens we setup the web application to use the same context too). The newer application did not have the memory leak so I decided to implement it here. I also figured that even if it didn’t fix the leak, this method is more efficient since there is no reason to have the context loaded everytime. To implement, I just overloaded the setSessionContext method:

Once implemented the leak went away. I never took the time to dig in and see what the true offender was, but it was found that some of the hibernate SingleTableEntityPersister objects were still present after leak. This could mean that it is Spring not properly cleaning things up or Hibernate itself has the leak.
As info this method was already implemented with our stateless EJB’s, so I could not confirm if the issue existed for AbstractStatelessSessionBean. However since both abstract classes use the unloadBeanFactory method from AbstractSessionBean, I would figure the issue would present itself — although due to Weblogic pooling the stateless EJB’s, it is probably not as noticable.
Specifics:
- Weblogic 8.1 sp4
- JRockit 1.4.2_13
- Spring 1.2.9
- Hibernate 3.2.5
Share This
Posted in Technology | No Comments »
Aug 25th, 2007 by Greg Alexander
We’ve had the opportunity to work with a lot of new technologies lately. Sometimes with friendly customer sites ;> but mostly within our own sites. Unidev strongly encourages and supports everyone within the company experimenting with new technologies as they come around. We do this by teaching internal classes, providing test web sites, providing a variety of real live high volume web sites for production testing as well as having a test lab with different operating systems, languages and browsers, Linux and Windows servers and pretty much any commercial software you could imagine.
The results of this policy are manyfold. The primary benefit of this goes to our customers as it ensures that we are using the very best available methods and tools for developing their software and websites. Recently a large customer with SQL Server and DB2 databases needed several dynamic data driven web pages quickly. We were able to deploy an Ajax tool we had created as an experiment for one of our internal web sites that worked very well and we were able to get the site developed very quickly.
Today we are continuing to experiment in the Windows .Net, Java/J2EE and Linux PHP areas. We continue working with new Ajax tools as well as Ruby on Rails, Microsoft Silverlight and databases, BLOGS, social networking, Hibernate, XML data messaging, RSS feeds and RSS feed readers (used to display news on the unidev home page).
Good Stuff
Share This
Posted in About Unidev, News | No Comments »