Well my session bean is working becouse I am able to use other methods from it.
I get no error when I deploy it in Jboss. In my EJB I obtain conection to
database like this :
Class.forName("org.postgresql.Driver");
DriverManager.getConnection("jdbc:postgresql://localhost:5432/Wybory",
"Mateusz",
"Mateusz");
Database is working on my localhost non stop.
Datasource is deployed
I I get an error when I invoke a bean method :
public int userVeryfication(String login,String haslo,String haslo2) throws
SQLException {
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File
| Settings | File Templates.
}
try {
con =
DriverManager.getConnection("jdbc:postgresql://localhost:5432/Wybory",
"Mateusz",
"Mateusz");
} catch (SQLException e) {
e.printStackTrace(); //To change body of catch statement use File
| Settings | File Templates.
}
try {
Statement stmt = con.createStatement();
} catch (SQLException e) {
e.printStackTrace(); //To change body of catch statement use File
| Settings | File Templates.
}
String sql = "SELECT * FROM urzytkownicy";
ResultSet rs = stmt.executeQuery(sql);
/* while(rs.next()){
int no = rs.getInt("id");
String id = rs.getString("login");
id.trim();
String pass = rs.getString("haslo1");
pass.trim();
String pass2 = rs.getString("haslo2");
pass2.trim();
int stan = rs.getInt("stan");
System.out.println(no + " " + id);
if((haslo == pass) && (login == id) && (haslo2 == pass2) &&(stan==0) )
{
return 1;
}else
return 0 ;
}*///end while
return 0;
}
And when saying I can get to my database throu JMX Console I mean that I can
connect with database throu JMX console and exetute every query I want
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3879443#3879443
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3879443
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user