Skip to Content
0
Former Member
Jan 26, 2008 at 08:21 PM

About JDBC System...

23 Views

Hi All,

I am trying to develop a Portal Application in NWDS with java.

My requirement is to create some tables and then to access them.

I created these tables with the Dictionary Prespective in the NWDS.

To have acces to a RDBMS i read that i have to create a JDBC System and then write a code like this

IConnectorGatewayService cgService =(IConnectorGatewayService) PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);

if (cgService == null) {

throw new ConnectorException("Error in get Connector Gateway Service");

}

ConnectionProperties cp =new ConnectionProperties(request.getLocale(),request.getUser());

IConnection conn = cgService.getConnection("tempdbalias", cp);

conn = getJDBCConnection("testdbalias", request);

INativeQuery query = conn.newNativeQuery();

ResultSet result = (ResultSet)query.execute("select vendorname from vendor");

My questions are :

Do i have access in the tables created in the NWDS with the above code?

Or i have to create tables in the DB with other way?

Please i will appreciate any help.

Regards,

Ari