Skip to main content

Posts

Showing posts from 2009

JavaEE 5 (JSF + JPA + EJB3) using Eclipse

Today I will show you how to create Enterprise Application using Java EE 5 and GlassFish. I will use - Eclipse 3.5 + WTP - GlassFish v. 2.1 - JSF Mojarra implementation. - EJB 3.0. - JPA Toplink essentials implementation. - MySQL No NetBeans or JDeveloper magic involved :) The prerequirement is: Add datasource in glassfish. Read this how you can make this here: http://gochev.blogspot.com/2009/10/creating-datasource-in-glassfish-v-21.html 1) First you need to add glassfish in your eclipse. - Go to Servers View - Right Click, New - Choose GlassFish v 2.1 if you dont have glassfish click on Download additional adapters link choose glassfish wait and restart eclipse. Than try again. 2) Create the database CREATE TABLE ` lesson ` . ` USERS ` ( ` id ` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, ` username ` VARCHAR ( 45 ) NOT NULL , ` password ` VARCHAR ( 45 ) NOT NULL , ` name ` VARCHAR ( 45 ) NOT NULL , PRIMARY KEY ( ` id ` ) ) ENGINE = InnoDB

Creating DataSource in GlassFish v. 2.1

I will show you how to create a DataSource in GlassFish version 2.1 because there were a lot of properties and I had a lot of problems when I've try to register datasource in glassfish for the first time. 1) You have to download JDBC driver for your database. For example I will use MySQL and I will use Connector/J driver that you can download from mysql official web site. 2) Place the JDBC driver in for example D:\glassfishv21\domains\domain1\lib\ext for example my driver is mysql-connector-java-5.0.4.jar 3) Start the domain for example domain1 (asadmin start-domain domain1) 4) go to http://localhost:4848 and login as admin. By default the username is 'admin' and the password is 'adminadmin' 5) go to Resources/JDBC/Connection Pools -First we will create a connection pool. Click the 'NEW' button -Than you must type: - Name: of the connection pool for example MySQL Lessson - Resource Type: javax.sql.ConnectionPoolDataSource - Database Vendor:

About Me

Superhero with Java powers && Gamer && (Sci-Fi & Star Wars geek) && Bulgarian Java User Group Fellow Leader && nerds2nerds podcaster && (link: http://java.beer) java.beer guy ? this : null  I believe the above is enough, isn't it ? Anyway if you one of this... well...  non developers ? or HRs or recruiters or something in between ... you can check even my CV  here .

Code Snippet Manager in Java and Swing

Today I've try to create code snippet manager using Java and Swing. In my previous post I try to done this using WPF and C# ( http://gochev.blogspot.com/2009/09/code-snipper-manager-in-c-and-wpf.html ) I've just wanted to see how harder is to create the same app using Java and Swing. First lets make some compare about the WPF and Swing version of the app. The WPF version consists of 5 files (2 XAML files and 3 cs files with classes) The WPF version uses XAML for the view (only 30 lines ) and 8 lines in file called App.xaml. The C# class with the logic is 208 lines of code . The Snippet model class is not 62 lines of code using C# properties and etc. The Java version have 3 classes. One is the main class, the snippet model class 54 lines (most of them created automatically by eclipse like getters setters in C# YOU HAVE TO WRITE THEM MANUALLY) and the Logic + View class is 290 lines of code . So in conclusion I can say that Java version is 40 lines of code more but this is bec

Java2Days conference in Bulgaria, Europe 8-9/10/09

Java2Days conference is a brand new event in Eastern Europe to present the latest trends in Java development. Java2Days will be held at the Inter Expo Center on 8-9 October in Sofia, Bulgaria. The conference is hosted by Insight_technologies and the Bulgarian National Academy for Software Development . The conference is the first of its kind to be held in Eastern Europe, focused to highlight today’s cutting edge trends in building software applications with Java development tools. Over two days, more than 600 attendees will meet world famous lecturers, engaged all year round in such events as JavaOne, The ServerSide Java Symposium, Jazoon showcasing their latest knowledge in creating more reliable, scalable and secure solutions using Java technologies in more than 20 technical sessions. The major purpose of the event is to become a place for passionate Java developers to get in touch with the latest technologies, to become a significant part of the global Java community and to learn f

XMLSerialization with C#

When I first hear about XML serialization in C# I thought that it is like Java serialization but the result is XML character stream instead of the default serialization in Java/.net. But the things are not so great. The XML serialization in C# is good but it is not the best. In Java the easiest way to make normal serialization is to implement interface Serializable and to be sure that all fields in your custom class are serializable. If you want to Serialize ArrayList of this objects you dont have problems because ArrayList implements Serializable. But when you use XML serialization you dont care about Serializable interface. In Java you can make XML serialization this way : http://www.javablogging.com/serialization-to-xml/ . You can see that it is simple I thought that in C# the situation is the same but it is not. To read about serialiization in C# there is tones of info but I didn't found answer like this one in this post: I will notice only some important aspects of this becaus

Code Snippet Manager in C# and WPF

Hello all, today I will post a simple code snippet manager created using C# and WPF. The idea of the app is to be used when making presentations and you need to paste all kind of code snippets (html, xaml, C#, java ). The similar tool is used by Karen Corby in MIX09 presentation about creating silverlight controls. This is my first .net application so you will see all kind of C# strangeness like using "Object" instead of "object" and String instead of "string". Because this was my first application I choose to use WPF not WinForms because WinForms is a lot like Swing and I've wanted to see "how declarative XML for the UI is better" and I can say: "hmm ok there is some big pluses". Anyway I have little experience with Flex's MXML too and if you ask me the MXML is a lot than XAML. The code snipper manager application lokks like this : The view is very simple and I can say that XAML is perfect for creating a simple views and there