public
Created

Script para criar um Data Source chamado 'jdbc/demoiselle' usando o banco Derby (em memória) para rodar um projeto Demoiselle de exemplo. Para saber mais, veja no http://blogs.oracle.com/brunoborges

  • Download Gist
create-demoiselle-ds.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
connect('weblogic', 'welcome1', 't3://localhost:7001')
 
edit()
startEdit()
 
cd('/')
cmo.createJDBCSystemResource('jdbc/demoiselle')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle')
cmo.setName('jdbc/demoiselle')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDataSourceParams/jdbc/demoiselle')
set('JNDINames',jarray.array([String('jdbc/demoiselle')], String))
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle')
cmo.setUrl('jdbc:derby://localhost:1527/demoiselle;ServerName=localhost;databaseName=demoiselle')
cmo.setDriverName('org.apache.derby.jdbc.ClientXADataSource')
setEncrypted('Password', 'Password_1389107767408', '/home/bruno/Work/tools/oracle/wls1212/user_projects/domains/base_domain/Script1389107730212Config', '/home/bruno/Work/tools/oracle/wls1212/user_projects/domains/base_domain/Script1389107730212Secret')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCConnectionPoolParams/jdbc/demoiselle')
cmo.setTestTableName('SQL SELECT 1 FROM SYS.SYSTABLES\r\n\r\n')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle')
cmo.createProperty('user')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle/Properties/user')
cmo.setValue('demoiselle')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle')
cmo.createProperty('portNumber')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle/Properties/portNumber')
cmo.setValue('1527')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle')
cmo.createProperty('databaseName')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle/Properties/databaseName')
cmo.setValue('demoiselle;create=true')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle')
cmo.createProperty('serverName')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDriverParams/jdbc/demoiselle/Properties/jdbc/demoiselle/Properties/serverName')
cmo.setValue('localhost')
 
cd('/JDBCSystemResources/jdbc/demoiselle/JDBCResource/jdbc/demoiselle/JDBCDataSourceParams/jdbc/demoiselle')
cmo.setGlobalTransactionsProtocol('TwoPhaseCommit')
 
cd('/JDBCSystemResources/jdbc/demoiselle')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))
 
save()
 
activate()
 
#stopEdit()
 
#activate()
 
exit()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.