J_security_check with mysql db?

Hi,
I've been trying to figure out this problem for a while now.
I have the following in my web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>All JSP direct access</web-resource-name>
<url-pattern>members/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<description>
No Access
</description>
<role-name>restricted</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>members/index.jsp</form-login-page>
<form-error-page>jsps/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>NO Access</description>
<role-name>restricted</role-name>
</security-role>
and:
<form method="POST" action="j_security_check">
<input type="text" name="j_username">
<input type="password" name="j_password">
<input type="submit" name="Submit" value="Submit">
in index.jsp
If i enter a username and password it just brings me back to the same error page (error.jsp). Infact i get the same thing with no matter what i try to access in /members/
Actually, i don't know how to link mySQL 5.1 to BeaWeblogic 8.1 i've read some documents about creating a security realm with RBDMS but there doesn't seem to be such option (i.e. theres LDAP, Active Directory) but nothing about a database. Any ideas?
Message was edited by:
hyowza
Message was edited by:
hyowza

Hi,
did you solve this problem? I have the same thing to do. I want to receive username and password from a html form pass it to a servlet, do some things and then call the standard j_security_check functionality.
regards
Guido

Similar Messages

  • OBIEE 11G with MySql Issue Hierarchy is not working..

    Hi,
    i am using the OBIEE 11G with MySQL DB. i have sucessfully created the RPD. i created the Hierarchy in the RPD. this is the scerario i have created.
    i have only one data column created_at. by using this column i create 3 more logical logical columns, which are Year,Month Name,Week and created Hierarchy by taking the these columns only.
    when i am viewing the result by taking the hierarchy it throwing the error systax error"ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version".
    but we selecting the year column it successfully nagvigating to the month level data but when selecting the Hierarchy directly it is unable to navigate from year to month.
    please provide me the solution for this as soon as possbile i have an urgent requirement on this.
    Thanks,
    Yogi.

    Hi,
    Thanks for you post..
    My Requriement is that we no need to create new columns we need to necessary columns in BMM layer only and we need to use them in Hierarchy.
    Thanks,
    Yogi.

  • Can' t connect Java with MySQL

    My goal is to connect Java with MySQL. I found many solutions on Internet, but I always get the same mistake:
    SQLException: No suitable driver
    SQLState: 08001
    VendorError: 0MySQL works fine alone or with php.Only thing left me to think is that the installed versions are not compatible for this mysql-connector-java-5.0.4
    I don't believe that could be a reason.
    Installed versions are:
    Apache Tomcat 5.5.20 Server
    Apache HTTP Server 2.2.4
    PHP 5.2.0
    MySQL 5.2
    jre 1.5.0_11
    jdk1.5.0_11
    Apache Tomacat JK2 connector Version: 1.2.20 File Name: mod_jk-apache-2.2.3.so
    mysql-connector-java-5.0.4
    I also set connector in class path: C:\mysql-connector-java-5.0.4;C:\mysql-connector-java-5.0.4\mysql-connector-java-5.0.4-bin.jar;C:\mysql-connector-java-5.0.4\src\com\mysql\jdbc
    For installation I used manulas from:
    http://apacheguide.org/jsp.php
    http://doc.51windows.net/mysql/?url=/MySQL/ch23s03.html
    Here is also a test code in java:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
       public class Connect
           public static void main (String[] args)
               Connection conn = null;
               try {
        conn =
           DriverManager.getConnection("jdbc:mysql://localhost/first_test" +
                                       "user=monty&password=greatsqldb");
        // Do something with the Connection
    } catch (SQLException ex) {
        // handle any errors
        System.out.println("SQLException: " + ex.getMessage());
        System.out.println("SQLState: " + ex.getSQLState());
        System.out.println("VendorError: " + ex.getErrorCode());
       }i'm desperate, please help or tell me someone who'll know the answer.
    Thank You in advance

    hey buddy .. it seems yr code is wrong .. in getconnection () method u should also specify the port ,which u r not doing ...
    the default port for MySQL is 3306 ... see below i am giving you a sample code ... its working fine .. and dont forget to put the MySQL driver jar path in to classpath and also copy the jar into common/lib folder of your tomcat ....
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class MySQLConnectionTest {
         public static void main(String[] args) {
    new MySQLConnectionTest().connTest();
    public void connTest() {
              String tableName = "portfolio"; //change as per setting
              String hostName = "10.81.9.39"; // please change for the target database ip or hostname
              String dbPort = "3306"; //change if not using the default
              String dbName = "tradingsystem"; //change as per the given DB name
              String username = "root"; //change as per setting
              String password = "password"; //change as per setting
              System.out.println("before try");
              Double data=0.0;
         Double data1=0.0;
              try {
    Class.forName("org.gjt.mm.mysql.Driver");
                   System.out.println("before driver manager");
    Connection conn = DriverManager.getConnection("jdbc:mysql://"+hostName+":"+dbPort+"/"+dbName, username, password);
    String query1 = "select * from "+tableName+" where User_id='trader1' and Stock_Type='Equity'";
    System.out.println("quesry1="+query1);
    Statement stmt = conn.createStatement();
    ResultSet rs1 = stmt.executeQuery(query1);
    while(rs1.next())
         System.out.println("hiiiiii for rs1");
         System.out.println(rs1);
         Quantity=(Integer)rs1.getObject(5);
         MarketPrice=(Double) rs1.getObject(8);
         data=Quantity*MarketPrice;
         data1+=data;
         System.out.println("data1="+data1);
         i=0;
    rs1.close();
    stmt.close();
    conn.close();
    } catch (ClassNotFoundException e) {
    e.printStackTrace(System.err);
    } catch (SQLException e) {
    e.printStackTrace(System.err);
    i hope it will work for u...
    cheers,

  • JDeveloper 10.1.2 with MySQL and PostgreSQL

    I'm testing JDeveloper 10.1.2 business components with mysql or postgresql because my company needs to connect also to these non-oracle DBs. ADF suits our developement needs, in speed and functionalities; anyway to make it our main developement system we need it to be compatible.
    I made three tests and they were all disappointing.
    At first, I installed MySQL 4.0 on my windows machine. I used the stable Connector/J 3.1
    and then MySQL Connector/J 3.0, but in both cases JDeveloper had a strange behaviour: I can make the connection, I can navigate correctly through all tables in the connection-navigator, I see all the column names etc... Anyway, as I try to build a "new Entity Object" from a table, there are no available table properties, like if the table had no columns.
    In this forum I only found documentation about rowid problems with mysql, but nothing about Entity Object wizard issues.
    Then I switched to PostgreSQL. I installed it locally, so I had to choose the 8.01 since I'm on a windows machine. JDBC driver: postgresql-8.0-310 jdbc3
    The developement test phase went ok, it is possible to use this DB just as if it was a Oracle, all the business components wizards works perfectly.
    The problem is at runtime, unfortunately. I built a simple datapage on the struts-config diagram and I dragged on it a "read-only table" from the data control palette.
    As I run the application, the embedded OC4J immediately returns this error:
    oracle.jbo.JboException: JBO-29000: JBO-29000: JBO-29000: JBO-26061: Errore durante lapertura della connessione JDBC.
    at oracle.jbo.JboException.<init>(JboException.java:343)
    (in english: Error during JDBC connection)
    There are no other available JDBC drivers for JVM 1.4x so I see no solution...
    I also tried to connect to an older PostgresSQL with its (older) JDBC but I get same the result.
    Anyone can help? Is it a JDev 10.1.2 issue?

    Hi Paolo.
    I'm also doing such tests.
    I did not ran into these problems because I created the busisness componentes using an Oracle connection first.
    After that, I switched the datatype of the table columns in the entity object to meet the SQL92 criteria ( like changing NUMBER(n) to INTEGER ).
    And then, I switched the connection to the postgreSQL or MySQL. This worked fine for me.
    But, the other big problem you will face is related to updating records using postgreSQL connection.
    Please see my post "Problem updating records using BC4J with foreign data sources" Problem updating records using BC4J with foreign data sources
    It would by fine if we help each other to solve this problems.
    Thanks
    Denis

  • Java with MYSQL in Linux

    i am using JSP in Linux Platform. when i connected to mysql with mysql driver for odbc by using the following code,
    import java.sql.*;
    public class TestMysql
    public static void main(String args[]) {
    try {
              Connection con;
              String connStr = "jdbc:mysql://localhost/test?user=root&password=mysql";
              Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
              System.out.println("OK");
              con = DriverManager.getConnection( connStr );
              System.out.println("Again OK");
    catch( Exception x )
    x.printStackTrace();
    i got the following exception
    OK
    java.sql.SQLException: Error during query: Unexpected Exception: java.io.CharConversionException message given: null
    Nested Stack Trace:
    ** BEGIN NESTED EXCEPTION **
    java.io.CharConversionException
    STACKTRACE:
    java.io.CharConversionException
    at gnu.gcj.convert.Input_iconv.read(char[], int, int) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.String.init(byte[], int, int, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.String.String(byte[], int, int, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at com.mysql.jdbc.SingleByteCharsetConverter.SingleByteCharsetConverter(java.lang.String) (Unknown Source)
    at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(java.lang.String) (Unknown Source)
    at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(java.lang.String, com.mysql.jdbc.Connection) (Unknown Source)
    at com.mysql.jdbc.Connection.getCharsetConverter(java.lang.String) (Unknown Source)
    at com.mysql.jdbc.StringUtils.getBytes(java.lang.String, java.lang.String, java.lang.String, boolean, com.mysql.jdbc.Connection) (Unknown Source)
    at com.mysql.jdbc.Buffer.writeStringNoNull(java.lang.String, java.lang.String, java.lang.String, boolean, com.mysql.jdbc.Connection) (Unknown Source)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(com.mysql.jdbc.Statement, java.lang.String, java.lang.String, com.mysql.jdbc.Buffer, int, com.mysql.jdbc.Connection, int, int, boolean, java.lang.String, boolean) (Unknown Source)
    at com.mysql.jdbc.Connection.execSQL(com.mysql.jdbc.Statement, java.lang.String, int, com.mysql.jdbc.Buffer, int, int, boolean, java.lang.String, boolean, boolean) (Unknown Source)
    at com.mysql.jdbc.Connection.configureClientCharacterSet() (Unknown Source)
    at com.mysql.jdbc.Connection.initializePropsFromServer() (Unknown Source)
    at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
    at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Properties, java.lang.String, java.lang.String) (Unknown Source)
    at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
    at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
    at java.sql.DriverManager.getConnection(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at TestMysql.main(java.lang.String[]) (Unknown Source)
    ** END NESTED EXCEPTION **
    at com.mysql.jdbc.Connection.execSQL(com.mysql.jdbc.Statement, java.lang.String, int, com.mysql.jdbc.Buffer, int, int, boolean, java.lang.String, boolean, boolean) (Unknown Source)
    at com.mysql.jdbc.Connection.configureClientCharacterSet() (Unknown Source)
    at com.mysql.jdbc.Connection.initializePropsFromServer() (Unknown Source)
    at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
    at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Properties, java.lang.String, java.lang.String) (Unknown Source)
    at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
    at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
    at java.sql.DriverManager.getConnection(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at TestMysql.main(java.lang.String[]) (Unknown Source)
    i have the database, hello.
    The same code works well in Windows, But in Linux, the above exception.
    By using the username root and password mysql , i can connect to mysql directly from the mysql prompt.
    Pls help me..
    I have already put the query 'access denied problem in Mysql' some day before. from the reply, i made some changes in user table(ie. set the password for [email protected].).After this change, this new Exception came..
    The structure of my mysql.user table is
    #     host                         user          password
    1     localhost                    root          68d4f47c49a579c9
    2     localhost.localdomain          root          68d4f47c49a579c9
    3     localhost.localdomain          
    4     localhost          
    Pls help me.
    Edited by: SUMESHBABU_R on Sep 30, 2007 11:36 PM

    Well, at least the trace tells me that this issue is to be tracked back to the core of the MySQL JDBC driver and the Linux's implementation of JVM. It might be worth the effort to post this issue at their website/forum/issuetracker. It might also be worth the effort to tryout the newer MySQL JDBC driver 5.1, as it is written specific for JDK 6.0 (while MySQL JDBC driver 5.0 is targeted at JDK 5.0).

  • Setting up testing server with MySQL

    I am just migrating to the MacBook from an older iMac G5. I was running PHP with MySQL 4.1.15. I just downloaded the PHP 5.2.2 and need to know which version of MySQL will run with it on my MacBook. Any help, please, especially if you are using Dreamweaver and have migrated to CS3. Thanks, Jay

    Hi
    I am successfully running MySQL 5.0.37 with PHP 5.2.1. (I don't use Dreamweaver or CS3 though.)
    Matt

  • How to use Ago function in BIEE with mysql database

    Hi experts,
    Ago function works well in Oracle database,but when I tried a mysql database,it didn't show results as expected. Anyone knows how to use Ago with mysql as data source?

    Hi Gurus, need help

  • Clob mapping not working with mysql

    Hi,
    I have an application that i'm running with MySQL and Oracle at the same
    time. At some point, i need to use a 'clob' mapping. When i do this, it
    just works fine with oracle but it fails with mysql. i have the exception:
    Field "com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description"
    is mapped as a clob, but should be represented as a different mapping.
    If the field is a string and you would like to force it to map as a
    clob, add an extension to its field metadata with a key of "jdbc-size"
    and a value of
    -1.[com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description]
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:132)
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:118)
         at
    kodo.jdbc.meta.ClobFieldMapping.fromMappingInfo(ClobFieldMapping.java:46)
    if i use a value mapping, it works with MySQL but fails with Oracle (I
    have sql error because a clob is used in a distinct select).
    In the manual, it is written "Note that some databases can support
    string of unlimited length without using a CLOB; when this is the case
    the mapping tool will install a value mapping in favor of
    this mapping.". So apparently, this is not the case with MySQLDictionary.
    To solve my problem and have my code working with both databases, i had
    to extend the MySQLDictionary and overwrite the replaceFieldMapping
    method in order to replace the clob mapping by a value mapping at
    runtime but i don't feel confident to do this kind of modifications by
    mysel and would expect this behaviour to be solved quite soon.
    Thanks for your help since this problem is urgent for us,
    Laurent Czinczenheim

    Laurent-
    The best solution would probably be to just have separate mappings for
    the MySQL and Oracle databases. The easiest way to accomplish this would
    be to have a separate setting for each of the databases. E.g.:
    kodo.jdbc.meta.MappingFactory: file(SingleFile=true, FileName=oracle.mapping)
    kodo.jdbc.meta.MappingFactory: file(SingleFile=true, FileName=mysql.mapping)
    That way, you can use a clob mapping for Oracle, and a normal value
    mapping for MySQL (since MySQL doesn't need to use the CLOB mapping, and
    it isn't very efficient).
    For more details on this, see:
    http://docs.solarmetric.com/manual.html#ref_guide_mapping_factory
    Another solution is to just stick with your custom extension of the
    MySQLDictionary, which is a perfectly valid way of having special CLOB
    handling in MySQL. Note, though, that CLOB handling is less efficient
    than VARCHAR handling, so it should be a mapping of last resort, and
    there isn't any need to use it in MySQL.
    In article <[email protected]>, czinczenheim wrote:
    Hi,
    I have an application that i'm running with MySQL and Oracle at the same
    time. At some point, i need to use a 'clob' mapping. When i do this, it
    just works fine with oracle but it fails with mysql. i have the exception:
    Field "com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description"
    is mapped as a clob, but should be represented as a different mapping.
    If the field is a string and you would like to force it to map as a
    clob, add an extension to its field metadata with a key of "jdbc-size"
    and a value of
    -1.[com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description]
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:132)
         at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:118)
         at
    kodo.jdbc.meta.ClobFieldMapping.fromMappingInfo(ClobFieldMapping.java:46)
    if i use a value mapping, it works with MySQL but fails with Oracle (I
    have sql error because a clob is used in a distinct select).
    In the manual, it is written "Note that some databases can support
    string of unlimited length without using a CLOB; when this is the case
    the mapping tool will install a value mapping in favor of
    this mapping.". So apparently, this is not the case with MySQLDictionary.
    To solve my problem and have my code working with both databases, i had
    to extend the MySQLDictionary and overwrite the replaceFieldMapping
    method in order to replace the clob mapping by a value mapping at
    runtime but i don't feel confident to do this kind of modifications by
    mysel and would expect this behaviour to be solved quite soon.
    Thanks for your help since this problem is urgent for us,
    Laurent Czinczenheim
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Powerdns with MySQL doesn't work

    I recently switched from ubuntu to Arch and I love it. However I have problems with PowerDNS running with MySQL database. When I set pdns.conf to
    launch=gmysql                                                                                                           
    gmysql-host=127.0.0.1                                                                                                   
    gmysql-user=user                                                                                                 
    gmysql-password=pass                                                                                             
    gmysql-dbname=database_name 
    and restart pdns i get this error:
    Oct 22 22:43:34 Archlinux pdns[3337]: Caught an exception instantiating a backend, cleaning up
    Oct 22 22:43:34 Archlinux pdns[3337]: gmysql Connection failed: Unable to connect to database: Lost connection to MySQL server at 'reading initial communication packet', system error: 0
    Socket connection doesn't work either.
    If someone could help me out of this I would be very happy.
    Best regards!
    Jernej

    It works! Thank you! Thank you! Thank you!
    I wasted so many hours combating this...
    I owe you a beer byte! Thx again!

  • About using hibernate with mysql

    hi all,
    i have used hibernate with hsqldb(database given by default) and it works fine.but when i tried to use it with mysql then i have encountered a problem
    xception
    org.hibernate.TransactionException: Transaction not successfully started
         org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
         events.EventManagerServlet.doGet(EventManagerServlet.java:63)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    though i have put jar file of mysql in lib directory and changed the driver name in hibernate.cfg.xml.
    can any one place some example illustrating the steps involving.thanx

    Hi smogura,
    Thanks for the message. Ok I did as you told. I believe I went to the right place:
    Resource->JDBC Connection pools. However I wasn't sure how exactly to go about setting connection pools,
    so I went to the web and did a search and I managed to get hold of this
    website:http://www.albeesonline.com/blog/2008/08/06/creating-and-configuring-a-mysql-datasource-in-
    glassfish-application-server/
    I followed from steps 4 onwards. However at step 14, I did not get a sucesfull ping. The values I used are as follows:
    General:
    Name:               MySQL
    Datasource Classname:     com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    Resource Type:           javax.sql.ConnectionPoolDataSource
    Advanced Properties:
    databaseName:      ebooking
    ServerName:     GlassFish
    URL          jdbc:mysql://localhost:3306/ebooking
    password          *****
    user:          1234
    I am not sure what is wrong, by the way, I am using Glassfish V3 that comes bundled with netbeans. Any idea what's wrong or missing? Thanks
    regards

  • Reconnect policy with MySQL failing because of autoCommit error

    This related to this issue, but I didn't see any responses to it: Reconnecting a dead connection from a UnitOfWork commit - Autocommit error
    I'm testing with MySQL 4.1 and I have a reconnect policy that does the following (I believe this is a pretty standard approach):
    session.setExceptionHandler( new ExceptionHandler() {
    public Object handleException(RuntimeException exception) {
         if (exception instanceof DatabaseException) {          
    dbex.getAccessor().reestablishConnection(dbex.getSession());
    However, when it reestablishes the connection (and I have traced this and can verify that this code is executing and a reconnect is performed), I get the following error for any updates:
    Internal Exception: java.sql.SQLException: Can't call rollback when autocommit=trueError Code: 0
    at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:277)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicRollbackTransaction(DatabaseAccessor.java:1090)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.rollbackTransaction(DatasourceAccessor.java:486)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.rollbackTransaction(DatabaseAccessor.java:1075)
    at oracle.toplink.publicinterface.Session.basicRollbackTransaction(Session.java:377)
    I only have this problem with the MySQL JDBC drivers. I can continue to read normally, but I can't perform any transactions.
    This isn't so much of a question about MySQL specifically, but rather a question about how reestablishConnection() connects to the database differently from my initial login using DatabaseLogin. Obviously, I don't have this error connecting normally. I only get it after a reconnect is applied.
    Specific questions are: Is there another handler I can add to ensure JDBC Connections returned by ServerSession are always setAutoCommit(false)? Am I reestablishing the JDBC connections incorrectly?
    Nate

    Nate,
    This does appear to be MySQL JDBC specific but is most likely related to a general issue.
    When the connection drops and you receive the notification through the exception handler I would typically recommend looking at the session in us (isUnitOfWork) or the query type (isWriteObjectQuery) to see if the operation that failed was involved in a transaction (UnitOfWork commit).
    In these transaction cases you need to do more then just re-connect and retry. You need to ensure after reconnection that an application exception is raised so the UnitOfWork operation(s) can be retried completely. I would simply add to this case to ensure that the JDBC connection is put back in a state where it can be managed properly.
    There is no special operation or any case I know of where any special auto-commit needs to be set on a connection after it has dropped and before it is re-connected.
    Doug

  • ExecuteQuery() error with MySQL

    I have already followed all the steps recommended by OTN to create a connection with MySQL (most up-to-date files) in JDeveloper 10g. It works fine except when I try to find a view and execute a query using an Application Module in a jsp:
    ApplicationModule appMod = appMod.getGenericAppMod();
    ViewObject voTabEmployee = appMod.findViewObject("TabEmployee");
    voTabEmployee.executeQuery();
    It works ok when connected to Oracle DB but it raises the following exception when I move Business Components to a MySQL connection, exactly as recommended:
    java.lang.ClassCastException: com.mysql.jdbc.ServerPreparedStatement
    Any help would be highly appreciated.
    Marcio

    Hi Marcio
    The ApplicationModule that you create in your source (utilApp.java) is created using the default configuration that uses the OracleSQLBuilder as the default SQLBuilder (configured to work with Oracle Databases). Thus, when you use MySQL or any other database (and I confirmed this using SQLServer), a ClassCastException is thrown.
    Instead of using the following lines:
    Context ic = new InitialContext(env);
    String theAMDefName = "mysysjcom.MySysJComModule";
    ApplicationModuleHome home = (ApplicationModuleHome) ic.lookup(theAMDefName);
    ApplicationModule appMod = home.create();
    appMod.getTransaction().connectToDataSource(null, "jdbc/MYSYSJCOMCoreDS", false);
    can you use the following lines:?
    Context ic = new InitialContext(env);
    String theAMDefName = "mysysjcom.MySysJComModule";
    ApplicationModule appMod = Configuration.createRootApplicationModule(theAMDefName, <config_name>);
    ic.lookup(theAMDefName);
    I got your sample working with the above change
    This will ensure that you are using the same configuration that has the SQLBuilder correctly set to your Database type
    Thanks
    Prasanth

  • Hoe to connect java with mysql 5.0

    I have installed the new Os. in that RHE-5 Os is there, now I want that java can connect ot mysql but , its not able connect with mysql so please guide me.

    1) download mysql connector/J JDBC driver from mysql.com
    2) put the driver jar somewhere where you can put it in the classpath of your application
    3) use proper setup code to connect to the database (search google, tons of examples)
    If at any step you have no clue what I am talking about, you need a good book to help you further.

  • Problems conecting java with mysql

    Hi, im workin' with mysql-connector-java-3.1.12 and it work on debug runtime but not when i access the .jar of the project.
    the code of conection is:
    try
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    con = DriverManager.getConnection(url,login,password);
    con.setAutoCommit(false);
    catch (Exception e)
    JOptionPane.showMessageDialog(null,"error en " + e.getMessage());
    there is no problems with code, it works!!, but i don't know what to do about of conection in the .jar
    I apreciate some help with this, Thankkkssss!!!

    Hi, im workin' with mysql-connector-java-3.1.12 and
    it work on debug runtime but not when i access the
    .jar of the project.Huh?
    the code of conection is:
    try
    lass.forName("com.mysql.jdbc.Driver").newInstance();
    con =
    DriverManager.getConnection(url,login,password);
    con.setAutoCommit(false);This is probably wrong. Unnecessary in this case - you aren't doing any writes.
    catch (Exception e)
    OptionPane.showMessageDialog(null,"error en " +
    e.getMessage());This is foolish code. You don't need Swing or a dialog box. You're printing less information than is available. Better to print the entire stack trace.
    is no problems with code, it works!!, Plenty of problems, really, regardless of whether it "works".
    You don't post your URL. That would help.
    but i don't
    know what to do about of conection in the .jar
    I apreciate some help with this, Thankkkssss!!!Put in the CLASSPATH, of course. NOT a system environment variable, either. javac.exe and java.exe ignore it. Use the -classpath option.
    %

  • Connectivity java with mySql

    Hi
    Can any one tell me how should i connect my java application with mySql database here is the small code which i written.
    import java.sql.*;
    class tryjdbc
         public static void main(String[] args) throws Exception
         try
              Class.forName("com.mysql.jdbc.Driver").newInstance();
              String connectionURL = "jdbc:mysql://localhost:3306/learn?user=root;password=";
              Connection connection = DriverManager.getConnection(connectionURL, "root", "");
              Statement statement = connection.createStatement();
              ResultSet rs = statement.executeQuery("Select ecode from emp");
              while (rs.next())
                   System.out.println(rs.getString("ecode"));
              catch (Exception e){
                   System.out.println(e);
    Can any one please tell me the error there is no eror in compiling but at run time it gives error
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    Thanks in advance
    Dhiraj

    Hi Dhiraj,
    String connectionURL = "jdbc:mysql://localhost:3306/learn?user=root;password=";
    Connection connection = DriverManager.getConnection(connectionURL, "root", "");
    It seems to be your trying to pass twice of your properties details. One from through URL and another from by pasing the parameters on getConnection() method. Better to avoid to use two place in same application. and one more thing I want to confirm r u using "stable" Driver or "alpha" Driver.
    Raju

Maybe you are looking for

  • Scanning using Organizer in Elements 10

    I am trying to scan photos from my canoscan 8600f to organizer  , when i do , organizer freezes and i get an error message of a big red cross and the word scangear underneath and after that the message "unable to open twain source please check connec

  • How to fix this error ?

    Ive got this problem that i tried installing an extension then at the end of the process it says : "cannot update insert bar.xml. extension will not be installed"

  • Improvement Suggestion: Add Animation to Movie Clips in Repositories

    Hi there, I have been trying to post this improvement suggestion by filling-in the corresponding form but it didn't allow me enough characters to describe it correctly. So I am posting it here now and going to reference it in the Improvement Suggesti

  • Adobe Air and Vista SP2

    Hi, I am trying to help somebody to view the advents calendar by Jacquie Lawson, which requires Adobe Air.  The lady has Vista SP2.  Ad obe Air is installed, but will not run.  I realize that it is a known problem, but has anybody found a way of deal

  • Make scanned text editableAdobe ExportPDF. Sign-in to export a PDF Now

    Need help in regard to above - to easily convert scaneed file on imac. This seem not to be working at times.Need step by step suggestion. would appreciate some help