Jump to content

java--ILOG rules

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Guest_roger_*

Guest_roger_*
  • Guests
i do the work on ILOG JRules.i have some problem related to ILOG JRules. i want access database with the help of ILOG JRules.so any person solve this problem ,help me .

i also want to know how i connect database in Java with the help of JDBC and ODBC.

#2
Guest_bernkly_*

Guest_bernkly_*
  • Guests
I dunno much about ILOG but if it's a logger than using Apache Logger (Log4j) is much faster even compare to java build-in logger.


Anyway, this is the jdbc-odbc connection.

public void getConnection() {

try { 


            // Step 1: Load the JDBC driver. 

            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 


            // Step 2: Establish the connection to the database. 

            String url = "jdbc:odbc:testDB"; 

            Connection conn = DriverManager.getConnection(url,"user1","password");  


        } catch (Exception e) { 

            System.err.println("Got an exception! "); 

            System.err.println(e.getMessage()); 

        }

}


Since you are using jdbc-odbc bridge... your database might need to be configure connection to odbc side.

1. -Start your ODBC program

1. -Click button Windows 'Start'

2. -Select from list 'Control Panel'

3. -Double click on icon 'Administrative Tools'

4. -Double click on icon 'Data Sources (ODBC)'

2. -Register your database

1. -Select tab 'System DSN'

2. -Click button 'Add'

3. -Select your driver

1. -Select from list either your db was MS Sql or MS Access
2. -Click button 'Finish'

4. -Fill in the data

1. Choose the real database name of for your database (e.g. TestDB)

2. Fill in possibly a description

e.g. test

3. Fill in which SQL server you want to
connect to

e.g. TEST

or you can skip the name if you are working
locally, by using (local)

4. Enter a 'Login ID'

e.g.

user1

Enter a password

e.g. password

5. -Click button 'Next'

6. -Enable checkbox 'Change the default database to'

1. -Select from list 'testDB'

5. -Click button 'Next'

6. -Click button 'Finish'

Just google for more information. "<the DBMS (e.g. MS Access)> ODBC to Database Setup"