Archive

Archive for the ‘postgresql’ Category

Xalos – utilidades de conexion a PostgreSQL

February 1st, 2012 xapiens No comments

ahora ando full exportando desde jasper, la idea es hacer un plugin que permita hacerlo de forma transparente, lidiando con java y C y los xml forms veo que la unica forma viable de hacer cosas en LibreOffice es mediante su star basic script.

a continuacion lo que desarrolle y encontre con respecto a conectarme a PostgreSQL


Dim sURL as String
Public SQLKeywords as String
Dim InfoProperties(6) as New com.sun.star.beans.PropertyValue
Public oConnection as Object

Function Connect() as Boolean
if isnull (oConnection) then
Dim driverManager As Object
driverManager = CreateUnoService("com.sun.star.sdbc.DriverManager")
'Fill the Info-Array of the DataSource with extra Values
sURL = "jdbc:postgresql://" & dbserver & ":" & dbport & "/" & dbname
InfoProperties(0).Name = "AutoIncrementCreation"
InfoProperties(0).Value = ""
InfoProperties(1).Name = "AutoRetrievingStatement"
InfoProperties(1).Value = ""
InfoProperties(2).Name = "EnableSQL92Check"
InfoProperties(2).Value = False
InfoProperties(3).Name = "IsAutoRetrievingEnabled"
InfoProperties(3).Value = False
InfoProperties(4).Name = "JavaDriverClass"
InfoProperties(4).Value = "org.postgresql.Driver"
InfoProperties(5).Name = "user"
InfoProperties(5).Value = dbuser
InfoProperties(6).Name = "password"
InfoProperties(6).Value = dbpwd
oConnection = driverManager.getConnectionWithInfo( sURL, InfoProperties() )
SQLKeywords = oConnection.getMetaData().getSQLKeywords()
else
rem oConnection.dispose
End if
Connect = true
End Function

Function getDBValueString (oSql as String) as String
Dim oRowSet as Object
Dim qcount
Connect()
oRowSet = createUnoService("com.sun.star.sdb.RowSet")
oRowSet.activeConnection = oConnection
oRowSet.Command = oSql
oRowSet.execute
qcount = oRowSet.getPropertyValue("RowCount")
if oRowSet.next() then
getDBValueString = oRowSet.getString(1)
else
getDBValueString = ""
end if
oRowSet.close
End Function

PodCast 01 con Jean Paul Argudo

July 23rd, 2008 xapiens Comments off

Entrevista con Jean Paul Argudo sobre Postgresql para la comunidad de Postgresql Peru.

Jean Paul Argudo es uno de los fundadores de la comunidad de Postgresql en Francia, y conversamos sobre temas diversos, como hacer negocios con codigo libre, la comunidad. como se inicio la comunidad en Francia y opiniones sobre IBM y su inversion en Postgresql.

podcast

Categories: postgresql Tags: